1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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

LIMIT history partitions cannot be checked by existing algorithm of
check_misplaced_rows() because working history partition is
incremented each time another one is filled. The existing algorithm
gets record and tries to decide partition id for it by
get_partition_id(). For LIMIT history it will just get first
non-filled partition.

To fix such partitions it is required to do REBUILD instead of REPAIR.
This commit is contained in:
Aleksey Midenkov
2019-12-02 11:48:37 +03:00
parent 6dd41e008e
commit a7cf0db3d8
3 changed files with 42 additions and 2 deletions

View File

@ -583,3 +583,17 @@ x a
3 bar
4 bar
drop table t1;
#
# MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
#
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;
Table Op Msg_type Msg_text
test.t1 check note Not supported for non-INTERVAL history partitions
test.t1 check note The storage engine for the table doesn't support check
drop table t1;

View File

@ -531,4 +531,19 @@ update t1 set a= 'bar' limit 4;
select * from t1;
drop table t1;
--echo #
--echo # MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
--echo #
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;
--source suite/versioning/common_finish.inc