diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-07-21 18:54:11 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-07-21 18:54:11 +0300 |
commit | 98357570b4e70941e481df07fcb06ec68b215b34 (patch) | |
tree | 4d3ac2a7059cada4184f97e9bbea601625b01c44 /sql/sql_table.cc | |
parent | 335a623c416928cc57b1ec4a5dbbfd7f6cb7373a (diff) | |
parent | 142afb1fed5ef7f9b90e67a7ce60b7960ec90ca3 (diff) | |
download | mariadb-git-98357570b4e70941e481df07fcb06ec68b215b34.tar.gz |
merge
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 6de461574d8..d3ac2bf0f95 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6507,7 +6507,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, uint index_add_count= 0; uint *index_add_buffer= NULL; uint candidate_key_count= 0; - bool committed= 0; bool no_pk; DBUG_ENTER("mysql_alter_table"); @@ -6848,6 +6847,14 @@ view_err: if (!error && (new_name != table_name || new_db != db)) { thd_proc_info(thd, "rename"); + + /* + Workaround InnoDB ending the transaction when the table instance + is unlocked/closed (close_cached_table below), otherwise the trx + state will differ between the server and storage engine layers. + */ + ha_autocommit_or_rollback(thd, 0); + /* Then do a 'simple' rename of the table. First we need to close all instances of 'source' table. @@ -7372,7 +7379,6 @@ view_err: DBUG_PRINT("info", ("Committing before unlocking table")); if (ha_autocommit_or_rollback(thd, 0) || end_active_trans(thd)) goto err1; - committed= 1; } /*end of if (! new_table) for add/drop index*/ |