From df0e1817c716a4b2c48d2f83d55f4d2549168843 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Fri, 26 Jan 2018 12:46:14 +0300 Subject: Vers SQL: partition rotation by INTERVAL fix Update partition stats on ha_partition::write_row() --- mysql-test/suite/versioning/t/partition.test | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'mysql-test/suite/versioning/t') diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index 1dea9f7c69c..d16bb4abc5c 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -122,7 +122,6 @@ alter table t1 add partition (partition px history); --echo ## INSERT, UPDATE, DELETE - create or replace table t1 (x int) with system versioning partition by system_time ( @@ -241,6 +240,7 @@ partition by system_time interval 0 second ( partition p1 history, partition pn current); +--echo ### ha_partition::update_row() check create or replace table t1 (x int) with system versioning partition by system_time interval 1 second ( @@ -248,14 +248,29 @@ partition by system_time interval 1 second ( partition p1 history, partition pn current); -insert into t1 values (1), (2), (3); +insert into t1 values (1), (2), (3), (4); select * from t1 partition (pn); -delete from t1; -select * from t1 partition (p0); +delete from t1 where x < 3; --sleep 2 -insert into t1 values (4); delete from t1; + +select * from t1 partition (p0) order by x; +select * from t1 partition (p1) order by x; + +--echo ### ha_partition::write_row() check +create or replace table t1 (x int) +with system versioning +partition by system_time interval 1 second ( + partition p0 history, + partition p1 history, + partition pn current); + +insert into t1 values (1); +update t1 set x= 2; +sleep 2; +update t1 set x= 3; +select * from t1 partition (p0); select * from t1 partition (p1); --echo ## Subpartitions -- cgit v1.2.1