Bug #95820 REPAIR TABLE on a functional table marks it as crashed
Submitted: 14 Jun 2019 23:04 Modified: 15 Jun 2019 6:19
Reporter: Manuel Rigger Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:8.0.16, 5.7.26, 5.6.44 OS:Ubuntu (18.10)
Assigned to: CPU Architecture:Any

[14 Jun 2019 23:04] Manuel Rigger
Description:
A sequence of INSERTS and REPLACE INTO that is followed by a REPAIR statement results in the following error on a subsequent access:

ERROR 144 (HY000): Table 't0' is marked as crashed and last (automatic?) repair failed

Since the table is not corrupted, I would expect the REPAIR statement to have no effect.

How to repeat:
CREATE TABLE t0(c0 INT UNIQUE, c1 INT, c2 INT UNIQUE) ENGINE = MyISAM;
INSERT INTO t0(c0) VALUES(DEFAULT), ("");
INSERT IGNORE INTO t0(c2) VALUES("a");
REPLACE INTO t0(c1, c0, c2) VALUES(1, DEFAULT, DEFAULT), (DEFAULT, "a", "a");
REPAIR TABLE t0 QUICK EXTENDED USE_FRM;
SELECT * FROM t0; -- unexpected: Table 'to' is marked as crashed and last (automatic?) repair failed
[15 Jun 2019 6:19] MySQL Verification Team
Hello Manuel Rigger,

Thank you for the report.

regards,
Umesh