summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning/t/partition.test
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2021-07-06 01:02:10 +0300
committerAleksey Midenkov <midenok@gmail.com>2021-07-06 01:02:10 +0300
commit07fade6d18148efbca3760fa5f7276443f318123 (patch)
tree28255ef49ca3eff59faecd9c68a56fa36a75c4e4 /mysql-test/suite/versioning/t/partition.test
parente09e304b78e50fcbdc84f5991229764b31346f9d (diff)
downloadmariadb-git-07fade6d18148efbca3760fa5f7276443f318123.tar.gz
MDEV-22247 History partition overflow leads to wrong SELECT result
Historical query with AS OF point after the last history partition must include last history partition because it can be overflown (contain history rows out of right endpoint). Move left point back to hist_part->id in that case.
Diffstat (limited to 'mysql-test/suite/versioning/t/partition.test')
-rw-r--r--mysql-test/suite/versioning/t/partition.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index d131bcfcc21..c5f6b242b53 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -706,6 +706,27 @@ alter table t1 partition by system_time (partition pn current);
# Cleanup
drop table t1;
+--echo #
+--echo # MDEV-22247 History partition overflow leads to wrong SELECT result
+--echo #
+set timestamp= unix_timestamp('2000-01-01 00:00:00');
+create or replace table t1 (x int) with system versioning
+partition by system_time interval 1 hour
+(partition p0 history, partition p1 history, partition pn current);
+
+insert into t1 values (0);
+update t1 set x= x + 1;
+
+set timestamp= unix_timestamp('2000-01-01 02:00:01');
+update t1 set x= x + 1;
+
+select *, row_start, row_end from t1 for system_time as of '2000-01-01 02:00:00';
+--replace_column 10 #
+explain partitions select * from t1 for system_time as of '2000-01-01 02:00:00';
+--replace_column 5 # 10 # 11 #
+explain partitions select * from t1;
+drop table t1;
+
--echo # End of 10.3 tests
--source suite/versioning/common_finish.inc