From 57e8203c116b5ae55c5117243d1ce51334c791ea Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Tue, 1 Dec 2009 01:01:27 +0300 Subject: Backport of: ------------------------------------------------------------ revno: 2630.4.14 committer: Dmitry Lenev branch nick: mysql-6.0-3726-w timestamp: Wed 2008-05-28 12:16:03 +0400 message: WL#3726 "DDL locking for all metadata objects". After review fixes in progress. Removed unused code and adjusted names of functions/methods to better reflect their current function. sql/mysql_priv.h: Changed names of close_data_files_and_morph_locks() and close_handle_and_leave_table_as_lock() to better reflect their current function (locking is now responsibility of metadata locking subsystem). sql/sql_base.cc: Changed names of close_data_files_and_morph_locks() and close_handle_and_leave_table_as_lock() to better reflect their current function (locking is now responsibility of metadata locking subsystem). Also adjusted comments describing these functions. Got rid of TABLE::open_placeholder since it is no longer used (its value is never read anywhere). TABLE::needs_reopen_or_name_lock() was renamed to needs_reopen() since we no longer use name-locks sql/sql_handler.cc: TABLE::needs_reopen_or_name_lock() was renamed to needs_reopen() since we no longer use name-locks. sql/sql_insert.cc: TABLE::needs_reopen_or_name_lock() was renamed to needs_reopen() since we no longer use name-locks sql/sql_partition.cc: Changed name of close_data_files_and_morph_locks() to better reflect its current function (locking is now responsibility of metadata locking subsystem). sql/sql_table.cc: Changed names of close_data_files_and_morph_locks() and close_handle_and_leave_table_as_lock() to better reflect their current function (locking is now responsibility of metadata locking subsystem). Got rid of TABLE::open_placeholder since it is no longer used. sql/sql_trigger.cc: Changed name of close_data_files_and_morph_locks() to better reflect its current function (locking is now responsibility of metadata locking subsystem). sql/table.h: Got rid of TABLE::open_placeholder which is no longer used altough its value was set in several places no code reads it). Removed unused TABLE::is_name_opened() method. Finally TABLE::needs_reopen_or_name_lock() was renamed to needs_reopen() since we no longer use name-locks. --- sql/sql_trigger.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_trigger.cc') diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index a623b3c80f3..a7a4d48b593 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -487,7 +487,8 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) if (!result && thd->locked_tables) { /* Make table suitable for reopening */ - close_data_files_and_morph_locks(thd, tables->db, tables->table_name); + close_data_files_and_leave_as_placeholders(thd, tables->db, + tables->table_name); thd->in_lock_tables= 1; if (reopen_tables(thd, 1)) { -- cgit v1.2.1