When I am altering one of my MySQL table to add an index I am getting below error in error log.
Table a/b contains 4 indexes inside InnoDB, which is different from the number of indexes 3 defined in the MySQL
What would be the exact root cause of this issue. Is the table not closed properly? I have read altering the table may remove the extra index which is causing the issue and we may create it later. But I want to know the exact reason why this is happening.
I am assuming inside innodb 4 indexes means those indexes definition updated in table
.frm
file and.ibd
file along withibdata1
. But what does it mean by "inside mysql"?
Edit (add CREATE)
CREATE TABLE b (
p datetime DEFAULT NULL,
q datetime DEFAULT NULL,
r bigint(20) NOT NULL,
s varchar(25) DEFAULT NULL,
t varchar(50) DEFAULT NULL,
u datetime DEFAULT NULL,
v varchar(50) DEFAULT NULL,
w varchar(20) DEFAULT NULL,
x longtext,
y longtext,
z bigint(20) DEFAULT NULL,
k bigint(20) DEFAULT NULL,
PRIMARY KEY (r),
KEY e (z),
KEY f (u),
KEY g (s)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE tablename;
and add the output in the question. Probably related to this bug: bugs.mysql.com/bug.php?id=70654select @@version ;
Also what is the exactALTER
statement that produces this error?