summaryrefslogtreecommitdiff
path: root/mysql-test/main/alter_table.test
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2021-11-03 12:31:47 +0300
committerAleksey Midenkov <midenok@gmail.com>2021-11-03 12:31:47 +0300
commit5cae401b00425746f157f448f2a8447d112cabdb (patch)
tree63a80a354caba759d2e7c86841d911435c902db0 /mysql-test/main/alter_table.test
parentb3bdc1c1425948295156b35b1dbed3f18deb4865 (diff)
downloadmariadb-git-5cae401b00425746f157f448f2a8447d112cabdb.tar.gz
MDEV-25555 Server crashes in tree_record_pos after INPLACE-recreating index on HEAP table
Drop and add same key is considered rename (look ALTER_RENAME_INDEX in fill_alter_inplace_info()). But in this case order of keys may be changed, because mysql_prepare_alter_table() yet does not know about rename and treats 2 operations: drop and add. In that case we disable inplace algorithm for such engines as Memory, MyISAM and Aria with ALTER_INDEX_ORDER flag. These engines have no specialized check_if_supported_inplace_alter() and default handler::check_if_supported_inplace_alter() sees an unknown flag and returns HA_ALTER_INPLACE_NOT_SUPPORTED. ha_innobase::check_if_supported_inplace_alter() works differently and inplace is not disabled (with the help of modified INNOBASE_INPLACE_IGNORE). add_drop_v_cols fork was also tweaked as it wrongly failed with MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN when it seen ALTER_INDEX_ORDER. No-op operation must be still no-op no matter of ALTER_INDEX_ORDER presence, so we tweek its condition as well.
Diffstat (limited to 'mysql-test/main/alter_table.test')
-rw-r--r--mysql-test/main/alter_table.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 85725820677..4f5cf8665d4 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -2609,5 +2609,17 @@ drop table t1;
set @@default_storage_engine= @save_default_engine;
--echo #
+--echo # MDEV-25555 Server crashes in tree_record_pos after INPLACE-recreating index on HEAP table
+--echo #
+create table t1 (a int, key idx1(a), key idx2 using btree(a)) engine=memory;
+alter table t1 rename index idx1 to idx3, algorithm=inplace;
+delete from t1 where a = 10;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t1 drop key idx3, add key idx1(a), algorithm=inplace;
+delete from t1 where a = 11;
+# cleanup
+drop table t1;
+
+--echo #
--echo # End of 10.5 tests
--echo #