[MDEV-28192] ERROR 1901 During ALTER Leading to frm table corruption Created: 2022-03-29  Updated: 2022-07-29  Resolved: 2022-07-29

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Oleksandr Byelkin
Resolution: Duplicate Votes: 0
Labels: corruption, not-10.2, not-10.3, regression

Issue Links:
Duplicate
duplicates MDEV-29203 Incorrect information in file: ... #s... Confirmed
Problem/Incident
is caused by MDEV-371 Unique indexes for blobs Closed
Relates
relates to MDEV-22759 Failing assertion: !cursor->index->is... Confirmed

 Description   

CREATE TABLE t (a INT AUTO_INCREMENT KEY) ENGINE=InnoDB;
ALTER TABLE t ADD UNIQUE u USING HASH (a);

Leads to:

10.9.0 5be92887c2caacb45af87b1131db952ce627e83a (Optimized and Debug)

10.9.0-opt>ALTER TABLE t ADD UNIQUE u USING HASH (a);
ERROR 1901 (HY000): Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `a`

10.9.0 5be92887c2caacb45af87b1131db952ce627e83a (Debug)

2022-03-29 18:00:32 4 [ERROR] mysqld: Incorrect information in file: './test/#sql-alter-870e-4.frm'

10.9.0 5be92887c2caacb45af87b1131db952ce627e83a (Optimized)

2022-03-29 18:14:23 4 [ERROR] mysqld: Incorrect information in file: './test/#sql-alter-140c3c-4.frm'

Bug confirmed present in:
MariaDB: 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)



 Comments   
Comment by Marko Mäkelä [ 2022-03-29 ]

I think that this is due to MDEV-371, which I have nothing to do with. InnoDB has no direct control over .frm files, and I suspect that the problems are repeatable with other storage engines as well.

Comment by Oleksandr Byelkin [ 2022-06-24 ]

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
CREATE TABLE t (a INT AUTO_INCREMENT KEY) ENGINE=InnoDB;
ALTER TABLE t ADD UNIQUE u USING HASH (a);
main.test 'innodb'                       [ fail ]
        Test ended at 2022-06-24 17:22:47
 
CURRENT_TEST: main.test
mysqltest: At line 4: query 'ALTER TABLE t ADD UNIQUE u USING HASH (a)' failed: 1901: Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `a`

Comment by Roel Van de Paar [ 2022-06-25 ]

sanja You closed this bug as "Cannot Reproduce" yet your MTR testcase shows the expected failure?

Comment by Roel Van de Paar [ 2022-07-29 ]

Marking this as duplicate of MDEV-29203, which is the same issue, better explained/reduced.

Generated at Thu Feb 08 09:58:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.