mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#20397: Crash at ALTER TABLE t1 engine = x; for partitioned table
mysql-test/r/partition_error.result: New test cases mysql-test/t/partition_error.test: New test cases sql/sql_table.cc: ALTER TABLE t1 engine = x; will behave exactly like ALTER TABLE t1; See no reason why one should change handler to something not specified in query when there is already something one is attached to.
This commit is contained in:
@ -4992,7 +4992,19 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
|
||||
old_db_type= table->s->db_type;
|
||||
if (!create_info->db_type)
|
||||
{
|
||||
if (create_info->used_fields & HA_CREATE_USED_ENGINE)
|
||||
{
|
||||
/*
|
||||
This case happens when the user specified
|
||||
ENGINE = x where x is a non-existing storage engine
|
||||
We clear the flag and treat it the same way
|
||||
as if no storage engine was specified.
|
||||
*/
|
||||
create_info->used_fields^= HA_CREATE_USED_ENGINE;
|
||||
}
|
||||
create_info->db_type= old_db_type;
|
||||
}
|
||||
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
if (prep_alter_part_table(thd, table, alter_info, create_info, old_db_type,
|
||||
|
Reference in New Issue
Block a user