revision-id: 975ab539c330d924491b6c6c9fcc77bab7eb21e4 (mariadb-10.5.2-445-g975ab539c33) parent(s): b85688df90600a39fd5f944c831ae8f777fbce4b author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2021-03-16 20:53:33 +0300 message: MDEV-7317: Make an index ignorable to the optimizer: more tests Add a test that marking index as [not] ignored uses algorithm=instant with InnoDB. --- mysql-test/main/ignore_indexes_innodb.result | 7 +++++++ mysql-test/main/ignore_indexes_innodb.test | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/mysql-test/main/ignore_indexes_innodb.result b/mysql-test/main/ignore_indexes_innodb.result new file mode 100644 index 00000000000..cc7af31ef97 --- /dev/null +++ b/mysql-test/main/ignore_indexes_innodb.result @@ -0,0 +1,7 @@ +create table t1 (a int, b int, key a1(a)) engine=innodb; +insert into t1 values (1,1),(2,2),(3,3); +set alter_algorithm='instant'; +alter table t1 alter index a1 ignored; +alter table t1 alter index a1 not ignored; +set alter_algorithm=default; +drop table t1; diff --git a/mysql-test/main/ignore_indexes_innodb.test b/mysql-test/main/ignore_indexes_innodb.test new file mode 100644 index 00000000000..c25cdc8d928 --- /dev/null +++ b/mysql-test/main/ignore_indexes_innodb.test @@ -0,0 +1,16 @@ +--source include/have_innodb.inc + +# +# Check if marking index as [not] ignored is an instant operation with InnoDB +# +create table t1 (a int, b int, key a1(a)) engine=innodb; +insert into t1 values (1,1),(2,2),(3,3); + +set alter_algorithm='instant'; +alter table t1 alter index a1 ignored; + +alter table t1 alter index a1 not ignored; + +set alter_algorithm=default; +drop table t1; +