summaryrefslogtreecommitdiff
path: root/mysql-test/main/alter_table.result
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.result
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.result')
-rw-r--r--mysql-test/main/alter_table.result10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 4c64578b974..faa74fb935f 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -3389,5 +3389,15 @@ test.t1 check status OK
drop table t1;
set @@default_storage_engine= @save_default_engine;
#
+# MDEV-25555 Server crashes in tree_record_pos after INPLACE-recreating index on HEAP table
+#
+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;
+alter table t1 drop key idx3, add key idx1(a), algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+delete from t1 where a = 11;
+drop table t1;
+#
# End of 10.5 tests
#