[MDEV-13079] Table x contains y indexes inside InnoDB, which is different from MySQL Created: 2017-06-13  Updated: 2017-09-21

Status: Confirmed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Storage Engine - InnoDB
Affects Version/s: 5.5
Fix Version/s: 5.5

Type: Bug Priority: Minor
Reporter: Eid Badr Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: upstream-fixed


 Description   

Can someone confirm that the bug from MySQL link title is fix?

Test case based on the upstream bug (change n as needed):

--source include/have_innodb.inc
 
drop table if exists t1;
create table t1(a int,b int,c int)engine=innodb;
drop procedure if exists p1;
--delimiter $
create procedure p1()
begin
  declare n int default 100;
  declare continue handler for sqlexception begin end;
  repeat
    set n= n-1;
    if rand()>0.5 then alter ignore table t1 add unique key a(a); end if;
    if rand()>0.5 then alter ignore table t1 add key b(b); end if;
    if rand()>0.5 then alter ignore table t1 add unique key ba(b,a); end if;
    if rand()>0.5 then alter ignore table t1 add key cba(c,b,a); end if;
    if rand()>0.5 then alter ignore table t1 add key abc(a,b,c); end if;
    if rand()>0.5 then alter ignore table t1 add key cb(c,b); end if;
    if rand()>0.5 then alter ignore table t1 drop key a; end if;
    if rand()>0.5 then alter ignore table t1 drop key b; end if;
    if rand()>0.5 then alter ignore table t1 drop key ba; end if;
    if rand()>0.5 then alter ignore table t1 drop key cba; end if;
    if rand()>0.5 then alter ignore table t1 drop key abc; end if;
    if rand()>0.5 then alter ignore table t1 drop key cb; end if;
    if rand()>0.5 then show table status like 't1'; end if;
  until n=0 end repeat;
end $
 
--delimiter ;
 
--send
call p1(); 
 
--connect (con1,localhost,root,,)
call p1();
--disconnect con1
--connection default
--reap
drop procedure p1;
drop table t1;

170921 18:25:54 [ERROR] Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 0 defined in the MySQL 
170921 18:26:01 [ERROR] Table test/t1 contains 3 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MySQL 
170921 18:26:02 [ERROR] Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL 
170921 18:26:07 [ERROR] Table test/t1 contains 1 indexes inside InnoDB, which is different from the number of indexes 0 defined in the MySQL 
...



 Comments   
Comment by Elena Stepanova [ 2017-09-21 ]

It's reproducible with MariaDB 5.5, but not with 10.x.

Generated at Thu Feb 08 08:02:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.