1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Vers SQL: partition rotation by INTERVAL fix

Update partition stats on ha_partition::write_row()
This commit is contained in:
Aleksey Midenkov
2018-01-26 12:46:14 +03:00
committed by Sergei Golubchik
parent 45e1c9bb6d
commit df0e1817c7
4 changed files with 56 additions and 23 deletions

View File

@@ -268,31 +268,50 @@ partition p0 history,
partition p1 history,
partition pn current);
ERROR HY000: Wrong parameters for partitioned `t1`: wrong value for 'INTERVAL'
### ha_partition::update_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), (2), (3);
insert into t1 values (1), (2), (3), (4);
select * from t1 partition (pn);
x
1
2
3
delete from t1;
select * from t1 partition (p0);
x
1
2
3
insert into t1 values (4);
4
delete from t1 where x < 3;
delete from t1;
Warnings:
Note 4114 Versioned table `test`.`t1`: switching from partition `p0` to `p1`
select * from t1 partition (p0) order by x;
x
1
2
select * from t1 partition (p1) order by x;
x
3
4
### 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;
update t1 set x= 3;
Warnings:
Note 4114 Versioned table `test`.`t1`: switching from partition `p0` to `p1`
select * from t1 partition (p0);
x
1
select * from t1 partition (p1);
x
4
2
## Subpartitions
create or replace table t1 (x int)
with system versioning