summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-11-07 23:18:12 +0200
committermonty@hundin.mysql.fi <>2001-11-07 23:18:12 +0200
commit1bc03e8b172102c4198cefadeda1ac49379ea19c (patch)
treef1c68494d0547ce79f742d6afdbb72452885ec00 /sql
parentaf2e13481ecc4dbae74fa5a4dc4f9d70ec498e39 (diff)
downloadmariadb-git-1bc03e8b172102c4198cefadeda1ac49379ea19c.tar.gz
Fix bug in ALTER TABLE on a TEMPORARY InnoDB table.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index cf788cee05f..725aed390be 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1509,6 +1509,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
my_free((gptr) new_table,MYF(0));
goto err;
}
+ /* Close lock if this is a transactional table */
+ if (thd->lock)
+ {
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock=0;
+ }
/* Remove link to old table and rename the new one */
close_temporary_table(thd,table->table_cache_key,table_name);
if (rename_temporary_table(thd, new_table, new_db, new_name))