[MDEV-26927] Table corruption with UNIQUE HASH key on a partitioned table (yet another one) Created: 2021-10-28  Updated: 2023-09-27

Status: Open
Project: MariaDB Server
Component/s: Partitioning, Server
Affects Version/s: 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Elena Stepanova
Resolution: Unresolved Votes: 0
Labels: None


 Description   

--source include/have_partition.inc
 
CREATE TABLE t (id int, c char(120), UNIQUE KEY USING HASH (id,c))
  PARTITION BY RANGE (id) (PARTITION p1 VALUES LESS THAN (10));
 
ALTER TABLE t ADD PARTITION (PARTITION p2 VALUES LESS THAN (100));
ALTER TABLE t FORCE;
ALTER TABLE t FORCE;

With InnoDB it causes ER_CRASHED_ON_USAGE followed by ER_NO_SUCH_TABLE_IN_ENGINE:

10.4 d74d9596

Query OK, 0 rows affected (0.158 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
MariaDB [test]> ALTER TABLE t FORCE;
ERROR 1194 (HY000): Table 't' is marked as crashed and should be repaired
MariaDB [test]> ALTER TABLE t FORCE;
ERROR 1932 (42S02): Table 'test.t' doesn't exist in engine

With MyISAM it's ER_GET_ERRNO (error code 190):

MariaDB [test]> ALTER TABLE t ADD PARTITION (PARTITION p2 VALUES LESS THAN (100));
Query OK, 0 rows affected (0.024 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
MariaDB [test]> ALTER TABLE t FORCE;
ERROR 1030 (HY000): Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You have to dump an" from storage engine MyISAM
MariaDB [test]> ALTER TABLE t FORCE;
ERROR 1030 (HY000): Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You have to dump an" from storage engine MyISAM

Related to UNIQUE HASH KEY, hence not reproducible on 10.3.



 Comments   
Comment by Oleksandr Byelkin [ 2023-09-27 ]

It looks like it was fixed:

CREATE TABLE t (id int, c char(120), UNIQUE KEY USING HASH (id,c))
PARTITION BY RANGE (id) (PARTITION p1 VALUES LESS THAN (10));
ALTER TABLE t ADD PARTITION (PARTITION p2 VALUES LESS THAN (100));
ALTER TABLE t FORCE;
ERROR HY000: Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You have to dump an" from storage engine MyISAM
ALTER TABLE t FORCE;
ERROR HY000: Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You have to dump an" from storage engine MyISAM

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