1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Versioning tests stability improvement

Fix SELECT resultset order.
This commit is contained in:
Aleksey Midenkov
2018-12-19 14:05:40 +03:00
committed by Sergei Golubchik
parent 8df04fb894
commit f6ee132491
5 changed files with 110 additions and 107 deletions

View File

@@ -14,24 +14,24 @@ let $slave_com_update_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_updat
connection master;
CREATE TABLE t1 (x int) with system versioning;
insert into t1 values (1);
SELECT * FROM t1;
select * from t1 order by x;
delete from t1;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
sync_slave_with_master;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
connection master;
insert into t1 values (2);
sync_slave_with_master;
select * from t1;
select * from t1 order by x;
connection master;
update t1 set x = 3;
sync_slave_with_master;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
--echo # check unversioned -> versioned replication
connection master;
@@ -42,20 +42,20 @@ alter table t1 with system versioning;
connection master;
insert into t1 values (1);
sync_slave_with_master;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
connection master;
update t1 set x= 2 where x = 1;
sync_slave_with_master;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
connection master;
delete from t1;
sync_slave_with_master;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
--echo # same thing (UPDATE, DELETE), but without PK
connection master;
@@ -67,14 +67,14 @@ connection master;
insert into t1 values (1);
update t1 set x= 2 where x = 1;
sync_slave_with_master;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
connection master;
delete from t1;
sync_slave_with_master;
select * from t1;
select * from t1 for system_time all;
select * from t1 order by x;
select * from t1 for system_time all order by row_end, x;
--echo # multi-update
connection master;
@@ -84,10 +84,10 @@ insert into t1 values (1);
insert into t2 values (2);
update t1, t2 set t1.x=11, t2.x=22;
sync_slave_with_master;
select * from t1;
select * from t2;
select * from t1 for system_time all;
select * from t2 for system_time all;
select * from t1 order by x;
select * from t2 order by x;
select * from t1 for system_time all order by row_end, x;
select * from t2 for system_time all order by row_end, x;
--echo # MDEV-14767 system_versioning_alter_history breaks ALTER replication
--echo ## Case 1: KEEP on the master, ALTER will work on the slave

View File

@@ -11,10 +11,10 @@ eval create table t1(
with system versioning;
insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
select x, y from t1;
select x, y from t1 order by x, y;
update t1 set y = y + 1 where x > 7;
select x, y from t1;
select x, y from t1 for system_time all;
select x, y from t1 order by x, y;
select x, y from t1 for system_time all order by sys_trx_end, x, y;
drop table t1;
replace_result $sys_datatype_expl SYS_DATATYPE;
@@ -56,7 +56,7 @@ update t1 set y= y + 1 where x > 4;
commit;
replace_result $sys_datatype_max MAXVAL;
eval select x, y, sys_trx_end = $sys_datatype_max as current from t1 for system_time all;
eval select x, y, sys_trx_end = $sys_datatype_max as current from t1 for system_time all order by sys_trx_end, x, y;
drop table t1;
@@ -95,8 +95,8 @@ with system versioning;
insert into t1(x, y) values (1, 1000), (3, 3000), (4, 4000), (5, 5000);
insert into t1(x, y) values(3, 3000) on duplicate key update y = y+1;
insert into t1(x, y) values(4, 4444) on duplicate key update y = y+1;
select x, y from t1 for system_time all;
select x, y from t1;
select x, y from t1 for system_time all order by sys_trx_end, x, y;
select x, y from t1 order by x, y;
drop table t1;
replace_result $sys_datatype_expl SYS_DATATYPE;
@@ -111,10 +111,10 @@ create table t2 like t1;
insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
insert into t2(x, y) values (1, 1010), (2, 2010), (3, 3010), (4, 4010), (5, 5010), (6, 6010), (7, 7010), (8, 8010), (9, 9010);
update t1, t2 set t1.y = t1.x + t1.y, t2.y = t2.x + t2.y where t1.x > 7 and t2.x < 7;
select x, y from t1 for system_time all;
select x, y from t1;
select x, y from t2 for system_time all;
select x, y from t2;
select x, y from t1 for system_time all order by sys_trx_end, x, y;
select x, y from t1 order by x, y;
select x, y from t2 for system_time all order by sys_trx_end, x, y;
select x, y from t2 order by x, y;
drop table t1;
drop table t2;