|
Note: If you run the test below with InnoDB for the table engine, run ANALYZE TABLE to get correct row numbers.
--source include/have_partition.inc
|
--source include/have_sequence.inc
|
|
create table t1 (a int) with system versioning partition by system_time limit 1000 auto;
|
insert into t1 select seq from seq_1_to_3000;
|
|
create table t2 (b int);
|
create trigger tr after insert on t2 for each row delete from t1 limit 1000;
|
|
insert into t2 values (1);
|
select partition_name, table_rows from information_schema.partitions where table_name = 't1';
|
|
insert into t2 values (2);
|
select partition_name, table_rows from information_schema.partitions where table_name = 't1';
|
|
# cleanup
|
drop tables t1, t2;
|
|
bb-10.5-midenok-MENT-654 256d3c1be
|
insert into t2 values (1);
|
select partition_name, table_rows from information_schema.partitions where table_name = 't1';
|
partition_name table_rows
|
p0 1000
|
pn 2000
|
insert into t2 values (2);
|
Warnings:
|
Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p0`) is out of LIMIT, need more HISTORY partitions
|
select partition_name, table_rows from information_schema.partitions where table_name = 't1';
|
partition_name table_rows
|
p0 2000
|
pn 1000
|
|