summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2018-05-17 09:33:04 +0300
committerSergei Golubchik <serg@mariadb.org>2018-05-22 13:11:14 +0200
commitaa5683d12e653a743f89b3ace87c62b97bd96dd2 (patch)
tree17bfefedaef2d05c22af9ad603d2770ce0ed96a2 /mysql-test
parent4ec8598c1dcb63499bce998142b8e5b8b09b2d30 (diff)
downloadmariadb-git-aa5683d12e653a743f89b3ace87c62b97bd96dd2.tar.gz
MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
In a test case Update occurs between Search and Delete/Update. This corrupts rowid which Search saves for Delete/Update. Patch prevents this by using of HA_EXTRA_REMEMBER_POS and HA_EXTRA_RESTORE_POS in a partition code. This situation possibly occurs only with system versioning table and partition. MyISAM and Aria engines are affected. fix by midenok Closes #705
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/versioning/r/partition.result18
-rw-r--r--mysql-test/suite/versioning/t/partition.test19
2 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index b1632d1c7a4..bfec0ce2d4b 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -483,6 +483,24 @@ delete from t1 where a is not null;
create or replace table t1 (i int) with system versioning partition by system_time limit 10 (partition p0 history, partition pn current);
select * from t1 partition (p0) for system_time all;
ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query
+# MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
+create or replace table t1 (pk int primary key)
+engine=myisam
+with system versioning
+partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
+Same test but for Aria storage engine
+create or replace table t1 (pk int primary key)
+engine=aria
+with system versioning
+partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
# Test cleanup
drop database test;
create database test;
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 02357f1a7ae..d9e784b082b 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -430,6 +430,25 @@ create or replace table t1 (i int) with system versioning partition by system_ti
--error ER_VERS_QUERY_IN_PARTITION
select * from t1 partition (p0) for system_time all;
+--echo # MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
+create or replace table t1 (pk int primary key)
+ engine=myisam
+ with system versioning
+ partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
+--echo Same test but for Aria storage engine
+create or replace table t1 (pk int primary key)
+ engine=aria
+ with system versioning
+ partition by key() partitions 3;
+set timestamp=1523466002.799571;
+insert into t1 values (11),(12);
+set timestamp=1523466004.169435;
+delete from t1 where pk in (11, 12);
+
--echo # Test cleanup
drop database test;
create database test;