[MDEV-21011] CHECK command wrongly reports table corruption Created: 2019-11-08  Updated: 2021-11-02  Resolved: 2019-12-02

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Versioned Tables
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.3.21, 10.4.11

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-25552 system versioned partitioned by LIMIT... Closed
Relates
relates to MDEV-21358 Implement CHECK for history partition... Open
relates to MDEV-21641 CHECK reports a misplaced row on part... Closed
relates to MDEV-22413 Server hangs upon UPDATE/DELETE on a ... Closed

 Description   

Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"

--source include/have_partition.inc
 
CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING PARTITION BY system_time LIMIT 3 (PARTITION p1 HISTORY, PARTITION p2 HISTORY, PARTITION pn CURRENT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
DELETE FROM t1;
DELETE FROM t1;
CHECK TABLE t1;
 
# Cleanup
DROP TABLE t1;

10.3 352e7667

CHECK TABLE t1;
Table	Op	Msg_type	Msg_text
test.t1	check	error	Found a misplaced row
test.t1	check	error	Partition p1 returned error
test.t1	check	error	Upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!

All of debug, ASAN, release builds produce the same result.
Reproducible on 10.3-10.5 with at least InnoDB, MyISAM, Aria.


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