diff options
author | unknown <svoj@mysql.com/june.mysql.com> | 2007-07-18 15:39:13 +0500 |
---|---|---|
committer | unknown <svoj@mysql.com/june.mysql.com> | 2007-07-18 15:39:13 +0500 |
commit | 035b06b4e1cacb0a1abe4c4272661827c2aa00ba (patch) | |
tree | c3850222308da2bc4493dc53c1d58bec35abdf0a /sql/sql_table.cc | |
parent | 7dc853561ce05b84e3116dc2d089206b77bd342a (diff) | |
download | mariadb-git-035b06b4e1cacb0a1abe4c4272661827c2aa00ba.tar.gz |
BUG#28838 - duplicate external_lock in mysql_alter_table
Removed duplicate call to handler::external_lock() when
ALTER TABLE that doesn't need to copy a table (quick
ALTER TABLE) was executed.
Also quick ALTER TABLE doesn't hold LOCK_open anymore when
it enables/disables indexes.
sql/sql_table.cc:
Do not call handler::external_lock() as table is already locked
by open_ltable().
Also do not hold LOCK_open mutex for alter_table_manage_keys() as
this function doesn't require LOCK_open (LOCK_open is required by
wait_while_table_is_used() only).
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 87f23097a66..277d6d76ead 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3789,11 +3789,9 @@ view_err: { VOID(pthread_mutex_lock(&LOCK_open)); wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN); - table->file->external_lock(thd, F_WRLCK); + VOID(pthread_mutex_unlock(&LOCK_open)); alter_table_manage_keys(table, table->file->indexes_are_disabled(), alter_info->keys_onoff); - table->file->external_lock(thd, F_UNLCK); - VOID(pthread_mutex_unlock(&LOCK_open)); error= ha_commit_stmt(thd); if (ha_commit(thd)) error= 1; |