summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorunknown <andrey@example.com>2006-11-16 13:18:37 +0100
committerunknown <andrey@example.com>2006-11-16 13:18:37 +0100
commit09fc514bd57be466589a8a4cc119ac34062d983e (patch)
treeef4104628c3be29fb5c459abcf5cc38f5848856f /mysql-test/t/alter_table.test
parent78278bc4f5c53324e895ebc30911da3687db0b53 (diff)
downloadmariadb-git-09fc514bd57be466589a8a4cc119ac34062d983e.tar.gz
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.
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 9bd34c2a610..eba456982c8 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -392,4 +392,22 @@ alter table test.t1 rename test.t1;
use test;
drop table t1;
+#
+# Bug#24219 - ALTER TABLE ... RENAME TO ... , DISABLE KEYS leads to crash
+#
+--disable_warnings
+DROP TABLE IF EXISTS bug24219;
+DROP TABLE IF EXISTS bug24219_2;
+--enable_warnings
+
+CREATE TABLE bug24219 (a INT, INDEX(a));
+
+SHOW INDEX FROM bug24219;
+
+ALTER TABLE bug24219 RENAME TO bug24219_2, DISABLE KEYS;
+
+SHOW INDEX FROM bug24219_2;
+
+DROP TABLE bug24219_2;
+
# End of 4.1 tests