summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authordavi@mysql.com/endora.local <>2007-11-28 10:18:01 -0200
committerdavi@mysql.com/endora.local <>2007-11-28 10:18:01 -0200
commitbd3f76d767e7dc78a73d68501271dcae9b0853aa (patch)
tree52f66ce381fbd991bde1883dbc2af7d811e16be4 /sql/sql_table.cc
parent9817d93edb65758128262bbf96beaab13be29d39 (diff)
downloadmariadb-git-bd3f76d767e7dc78a73d68501271dcae9b0853aa.tar.gz
Bug#31479 Bad lock interaction if CREATE TABLE LIKE is killed
Kill of a CREATE TABLE source_table LIKE statement waiting for a name-lock on the source table causes a bad lock interaction. The mysql_create_like_table() has a bug that if the connection is killed while waiting for the name-lock on the source table, it will jump to the wrong error path and try to unlock the source table and LOCK_open, but both weren't locked. The solution is to simple return when the name lock request is killed, it's safe to do so because no lock was acquired and no cleanup is needed. Original bug report also contains description of other problems related to this scenario but they either already fixed in 5.1 or will be addressed separately (see bug report for details).
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 0838b805b35..de7ccb7b86f 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2761,7 +2761,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST *src_table,
operations on the target table.
*/
if (lock_and_wait_for_table_name(thd, src_table))
- goto err;
+ DBUG_RETURN(res);
pthread_mutex_lock(&LOCK_open);