mariadb/sql
Konstantin Osipov 736db89a76 Backport of:
------------------------------------------------------------
revno: 2617.69.37
committer: Dmitry Lenev <dlenev@mysql.com>
branch nick: mysql-next-bg46748
timestamp: Fri 2009-08-21 18:17:02 +0400
message:
  Fix for bug #46748 "Assertion in MDL_context::wait_for_locks()
  on INSERT + CREATE TRIGGER".

  Concurrent execution of statements involving stored functions or triggers
  which were using several tables and DDL statements which affected those
  tables on debug build of server might have led to assertion failures in
  MDL_context::wait_for_locks(). Non-debug build was not affected.

  The problem was that during back-off which happens when open_tables()
  encounters conflicting metadata lock for one of the tables being open
  we didn't reset MDL_request::ticket value for requests which correspond
  to tables from extended prelocking set. Since these requests are part
  of of list of requests to be waited for in Open_table_context this broke
  assumption that ticket value for them is 0 in MDL_context::wait_for_locks()
  and caused assertion failure.

  This fix ensures that close_tables_for_reopen(), which performs this back-off
  resets MDL_request::ticket value not only for tables directly used by the
  statement but also for tables from extended prelocking set, thus satisfying
  assumption described above.



mysql-test/r/mdl_sync.result:
  Added test case for bug #46748 "Assertion in MDL_context::wait_for_locks()
  on INSERT + CREATE TRIGGER".
mysql-test/t/mdl_sync.test:
  Added test case for bug #46748 "Assertion in MDL_context::wait_for_locks()
  on INSERT + CREATE TRIGGER".
sql/sql_base.cc:
  Since metadata lock requests for tables from extended part of prelocking
  set are also part of list of requests to be waited for in Open_table_context
  in close_tables_for_reopen() we have to reset MDL_request::ticket 
  values for them to assumptions in MDL_context::wait_for_locks().
2009-12-09 12:44:05 +03:00
..
examples
share
.cvsignore
add_errmsg
authors.h
client_settings.h
CMakeLists.txt
contributors.h
custom_conf.h
debug_sync.cc
debug_sync.h
derror.cc
des_key_file.cc
discover.cc
event_data_objects.cc
event_data_objects.h
event_db_repository.cc
event_db_repository.h
event_parse_data.cc
event_parse_data.h
event_queue.cc
event_queue.h
event_scheduler.cc
event_scheduler.h
events.cc
events.h
field.cc
field.h
field_conv.cc
filesort.cc
frm_crypt.cc
gen_lex_hash.cc
gstream.cc
gstream.h
ha_ndbcluster.cc
ha_ndbcluster.h
ha_ndbcluster_binlog.cc
ha_ndbcluster_binlog.h
ha_ndbcluster_cond.cc
ha_ndbcluster_cond.h
ha_ndbcluster_tables.h
ha_partition.cc
ha_partition.h
handler.cc
handler.h
hash_filo.cc
hash_filo.h
hostname.cc
init.cc
item.cc
item.h
item_buff.cc
item_cmpfunc.cc
item_cmpfunc.h
item_create.cc
item_create.h
item_func.cc
item_func.h
item_geofunc.cc
item_geofunc.h
item_row.cc
item_row.h
item_strfunc.cc
item_strfunc.h
item_subselect.cc
item_subselect.h
item_sum.cc
item_sum.h
item_timefunc.cc
item_timefunc.h
item_xmlfunc.cc
item_xmlfunc.h
key.cc
lex.h
lex_symbol.h
lock.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
log.cc
log.h
log_event.cc
log_event.h
log_event_old.cc
log_event_old.h
Makefile.am
mdl.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
mdl.h Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
message.h
message.mc
message.rc
mf_iocache.cc
MSG00001.bin
my_decimal.cc
my_decimal.h
my_lock.c
mysql_priv.h Backport of: 2009-12-09 12:04:55 +03:00
mysql_priv.h.pp
mysqld.cc
mysqld_suffix.h
net_serv.cc
nt_servc.cc
nt_servc.h
opt_range.cc
opt_range.h
opt_sum.cc
parse_file.cc
parse_file.h
partition_element.h
partition_info.cc
partition_info.h
password.c
procedure.cc
procedure.h
protocol.cc
protocol.h
records.cc
records.h
repl_failsafe.cc
repl_failsafe.h
replication.h
rpl_constants.h
rpl_filter.cc
rpl_filter.h
rpl_handler.cc
rpl_handler.h
rpl_injector.cc
rpl_injector.h
rpl_mi.cc
rpl_mi.h
rpl_record.cc
rpl_record.h
rpl_record_old.cc
rpl_record_old.h
rpl_reporting.cc
rpl_reporting.h
rpl_rli.cc
rpl_rli.h
rpl_tblmap.cc
rpl_tblmap.h
rpl_utility.cc
rpl_utility.h
scheduler.cc
scheduler.h
set_var.cc
set_var.h
slave.cc
slave.h
sp.cc
sp.h Backpo 2009-12-09 12:17:17 +03:00
sp_cache.cc
sp_cache.h
sp_head.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
sp_head.h
sp_pcontext.cc
sp_pcontext.h
sp_rcontext.cc
sp_rcontext.h
spatial.cc
spatial.h
sql_acl.cc
sql_acl.h
sql_analyse.cc
sql_analyse.h
sql_array.h
sql_base.cc Backport of: 2009-12-09 12:44:05 +03:00
sql_binlog.cc
sql_bitmap.h
sql_builtin.cc.in
sql_cache.cc
sql_cache.h
sql_class.cc
sql_class.h
sql_client.cc
sql_connect.cc
sql_crypt.cc
sql_crypt.h
sql_cursor.cc
sql_cursor.h
sql_db.cc
sql_delete.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
sql_derived.cc
sql_do.cc
sql_error.cc
sql_error.h
sql_handler.cc Backport of: 2009-12-09 12:04:55 +03:00
sql_help.cc
sql_insert.cc
sql_lex.cc
sql_lex.h
sql_list.cc
sql_list.h
sql_load.cc
sql_locale.cc
sql_manager.cc
sql_map.cc
sql_map.h
sql_olap.cc
sql_parse.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
sql_partition.cc
sql_partition.h
sql_plist.h
sql_plugin.cc
sql_plugin.h
sql_plugin_services.h
sql_prepare.cc
sql_prepare.h
sql_profile.cc
sql_profile.h
sql_rename.cc
sql_repl.cc
sql_repl.h
sql_select.cc
sql_select.h
sql_servers.cc
sql_servers.h
sql_show.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
sql_show.h
sql_signal.cc
sql_signal.h
sql_sort.h
sql_state.c
sql_string.cc
sql_string.h
sql_table.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
sql_tablespace.cc
sql_test.cc
sql_trigger.cc Backport of: 2009-12-09 12:37:54 +03:00
sql_trigger.h
sql_udf.cc
sql_udf.h
sql_union.cc
sql_update.cc
sql_view.cc
sql_view.h
sql_yacc.yy
strfunc.cc
structs.h
table.cc Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
table.h Backport of revno: 2617.69.40 2009-12-09 09:51:20 +01:00
thr_malloc.cc
time.cc
transaction.cc
transaction.h
tzfile.h
tztime.cc
tztime.h
udf_example.c
udf_example.def
uniques.cc
unireg.cc
unireg.h