Commit b15a5f6f authored by Aleksey Midenkov's avatar Aleksey Midenkov Committed by Sergei Golubchik

MDEV-26767 Server crashes when rename table and alter storage engine

Wrong assertion leftover removed. m_sql_cmd can be allocated by any
ALTER subcommand and before allocation it is checked for NULL first.
parent 69724805
......@@ -3375,3 +3375,8 @@ drop table t1;
#
# End of 10.5 tests
#
#
# MDEV-26767 Server crashes when rename table and alter storage engine
#
alter table txxx engine=innodb, rename to tyyy;
ERROR 42S02: Table 'test.txxx' doesn't exist
......@@ -2570,3 +2570,9 @@ drop table t1;
--echo #
--echo # End of 10.5 tests
--echo #
--echo #
--echo # MDEV-26767 Server crashes when rename table and alter storage engine
--echo #
--error ER_NO_SUCH_TABLE
alter table txxx engine=innodb, rename to tyyy;
......@@ -11260,7 +11260,6 @@ bool LEX::stmt_alter_table_exchange_partition(Table_ident *table)
bool LEX::stmt_alter_table(Table_ident *table)
{
DBUG_ASSERT(sql_command == SQLCOM_ALTER_TABLE);
DBUG_ASSERT(!m_sql_cmd);
first_select_lex()->db= table->db;
if (first_select_lex()->db.str == NULL &&
copy_db_to(&first_select_lex()->db))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment