diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index b2cfd079ff5..9fbd585e25a 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -270,8 +270,8 @@ ERROR 42000: Incorrect table name '' drop table t1; drop table if exists t1, t2; Warnings: -Note 1051 Unknown table 't1' -Note 1051 Unknown table 't2' +Note 1051 Unknown table 'test.t1' +Note 1051 Unknown table 'test.t2' create table t1 ( a varchar(10) not null primary key ) engine=myisam; create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1); flush tables; @@ -415,7 +415,7 @@ alter table t1 drop key a; drop table t1; CREATE TABLE T12207(a int) ENGINE=MYISAM; ALTER TABLE T12207 DISCARD TABLESPACE; -ERROR HY000: Table storage engine for 'T12207' doesn't have this option +ERROR HY000: Storage engine MyISAM of the table `test`.`T12207` doesn't have this option DROP TABLE T12207; create table t1 (a text) character set koi8r; insert into t1 values (_koi8r'ΤΕΣΤ'); @@ -556,7 +556,7 @@ create database mysqltest; create table t1 (c1 int); alter table t1 rename mysqltest.t1; drop table t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' alter table mysqltest.t1 rename t1; drop table t1; create table t1 (c1 int); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d1b149065b2..75876dbf7e5 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5875,7 +5875,6 @@ void THD::reset_for_next_command(bool calculate_userstat) DBUG_ENTER("mysql_reset_thd_for_next_command"); DBUG_ASSERT(!thd->spcont); /* not for substatements of routines */ DBUG_ASSERT(! thd->in_sub_stmt); - DBUG_ASSERT(thd->transaction.on); thd->free_list= 0; thd->select_number= 1; /* diff --git a/sql/sql_table.cc b/sql/sql_table.cc index d58a76903a2..4d39fded1b6 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7278,11 +7278,14 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list, TABLE *table= table_list->table; MDL_ticket *mdl_ticket= table->mdl_ticket; int error= 0; + enum ha_extra_function extra_func= thd->locked_tables_mode + ? HA_EXTRA_NOT_USED + : HA_EXTRA_FORCE_REOPEN; DBUG_ENTER("simple_rename_or_index_change"); if (keys_onoff != Alter_info::LEAVE_AS_IS) { - if (wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN)) + if (wait_while_table_is_used(thd, table, extra_func)) DBUG_RETURN(true); // It's now safe to take the table level lock. @@ -7325,7 +7328,7 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list, simple rename did nothing and therefore we can safely return without additional clean-up. */ - if (wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN)) + if (wait_while_table_is_used(thd, table, extra_func)) DBUG_RETURN(true); close_all_tables_for_name(thd, table->s, HA_EXTRA_PREPARE_FOR_RENAME, NULL);