Skip to content

Commit

Permalink
MDEV-7317: Make an index ignorable to the optimizer: more tests
Browse files Browse the repository at this point in the history
Add a test that marking index as [not] ignored uses algorithm=instant
with InnoDB.
  • Loading branch information
spetrunia committed Mar 17, 2021
1 parent d9c5eb2 commit 707101d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mysql-test/main/ignore_indexes_innodb.result
Original file line number Diff line number Diff line change
@@ -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;
16 changes: 16 additions & 0 deletions mysql-test/main/ignore_indexes_innodb.test
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 707101d

Please sign in to comment.