Backport of:
------------------------------------------------------------ revno: 2630.4.11 committer: Dmitry Lenev <dlenev@mysql.com> branch nick: mysql-6.0-3726-w timestamp: Tue 2008-05-27 21:31:53 +0400 message: WL#3726 "DDL locking for all metadata objects". After review fixes in progress. Changed mysql_lock_tables() to be no longer responsible for reopening table if waiting for the lock on it was aborted. This allows to get rid of several annoying functions. sql/ha_ndbcluster_binlog.cc: lock_tables() now also accepts set of options to be passed to mysql_lock_tables(). sql/lock.cc: Changed mysql_lock_tables() always requests caller to reopen table instead doing this on its own when waiting for lock was aborted. This allows us to get rid of several functions which were used in rare cases and significantly complicated our life. sql/log_event_old.cc: lock_tables() now also accepts set of options to be passed to mysql_lock_tables(). sql/mysql_priv.h: Now mysql_lock_tables() always requests caller to reopen table instead doing this on its own when waiting for lock was aborted. So we no longer need wait_for_tables() and table_is_used() functions and MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN flag. open_and_lock_table_derived() and lock_tables() now accept options to be passed to open_tables() and mysql_lock_tables() calls. sql/sql_base.cc: Since now mysql_lock_tables() always requests caller to reopen table instead doing this on its own when waiting for lock was aborted we no longer need wait_for_tables(), table_is_used() and close_old_data_files() functions. open_and_lock_table_derived() and lock_tables() now accept options to be passed to open_tables() and mysql_lock_tables() calls. This was needed in order to get rid of redundant code in open_system_tables_for_read() function. sql/sql_handler.cc: mysql_lock_tables() is now always requests reopen if waiting for lock is aborted. MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN flag was removed. sql/sql_insert.cc: handle_delayed_insert(): Since mysql_lock_tables() is no longer responsible for reopening tables when waiting for lock was aborted we have to handle such situation outside of this function. To simplify this extracted code opening table for delayed insert thread to separate method of Delayed_insert class. sql/sql_update.cc: lock_tables() now also accepts set of options to be passed to mysql_lock_tables().
Showing
This diff is collapsed.
Please register or sign in to comment