mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for bug#24219 ALTER TABLE ... RENAME TO ... , DISABLE KEYS leads to crash
There was an improper order of doing chained operations. To the documentor: ENABLE|DISABLE KEYS combined with RENAME TO, and no other ALTER TABLE clause, leads to server crash independent of the presence of indices and data in the table. mysql-test/r/alter_table.result: update result mysql-test/t/alter_table.test: add test for bug#24129 sql/sql_table.cc: If there is operation on the KEYS, first do it and then do a rename if there is such. Or, we will crash because the underlying table has changed.
This commit is contained in:
@ -543,3 +543,14 @@ ERROR 3D000: No database selected
|
||||
alter table test.t1 rename test.t1;
|
||||
use test;
|
||||
drop table t1;
|
||||
DROP TABLE IF EXISTS bug24219;
|
||||
DROP TABLE IF EXISTS bug24219_2;
|
||||
CREATE TABLE bug24219 (a INT, INDEX(a));
|
||||
SHOW INDEX FROM bug24219;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
bug24219 1 a 1 a A NULL NULL NULL YES BTREE
|
||||
ALTER TABLE bug24219 RENAME TO bug24219_2, DISABLE KEYS;
|
||||
SHOW INDEX FROM bug24219_2;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
bug24219_2 1 a 1 a A NULL NULL NULL YES BTREE disabled
|
||||
DROP TABLE bug24219_2;
|
||||
|
Reference in New Issue
Block a user