summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2019-12-02 11:48:37 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-12-02 11:48:37 +0300
commita7cf0db3d866d92ca54d4ba5f15f3cc3f8b48d31 (patch)
tree91cb6d2ce0aea0d081a4ec747d3034330a3767bb /mysql-test/suite/versioning
parent6dd41e008eb2e384913d970e79aa01cd886891ec (diff)
downloadmariadb-git-a7cf0db3d866d92ca54d4ba5f15f3cc3f8b48d31.tar.gz
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.
Diffstat (limited to 'mysql-test/suite/versioning')
-rw-r--r--mysql-test/suite/versioning/r/partition.result14
-rw-r--r--mysql-test/suite/versioning/t/partition.test15
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 315413fbd7d..3fd6c1f55d4 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -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;
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index ce8c2e5ec1a..5b23d893974 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -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