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

Tests: split versioning.select into combinations

This commit is contained in:
Aleksey Midenkov
2017-03-15 18:36:54 +03:00
parent fb0b3e5902
commit 1894fab11a
18 changed files with 486 additions and 186 deletions

View File

@@ -204,4 +204,5 @@ select * from t;
call verify_vtq;
drop table t;
drop procedure verify_vtq;
-- source suite/versioning/common_finish.inc

View File

@@ -64,5 +64,5 @@ call test_01('bigint unsigned', 'innodb', 'vtq_commit_ts(sys_end)');
call verify_vtq;
drop procedure test_01;
drop procedure verify_vtq;
-- source suite/versioning/common_finish.inc

View File

@@ -6,7 +6,6 @@ with system versioning
engine innodb;
# VTQ_ISO_LEVEL #
set transaction isolation level read uncommitted;
@@ -76,4 +75,5 @@ select
drop table t1;
call verify_vtq;
drop procedure verify_vtq;
-- source suite/versioning/common_finish.inc

View File

@@ -117,4 +117,5 @@ call verify_vtq;
drop procedure test_01;
drop procedure test_02;
drop procedure test_03;
drop procedure verify_vtq;
-- source suite/versioning/common_finish.inc

View File

@@ -193,4 +193,5 @@ drop procedure test_02;
drop procedure test_03;
drop procedure test_04;
drop procedure test_05;
drop procedure verify_vtq;
-- source suite/versioning/common_finish.inc

View File

@@ -0,0 +1,5 @@
[innodb]
default-storage-engine=innodb
[myisam]
default-storage-engine=myisam

View File

@@ -1,11 +1,12 @@
-- source suite/versioning/common.inc
delimiter ~~;
create procedure test_01(
sys_type varchar(255),
engine varchar(255),
fields varchar(255))
create procedure test_01()
begin
declare engine varchar(255) default default_engine();
declare sys_type varchar(255) default sys_datatype();
declare fields varchar(255) default sys_commit_ts('sys_start');
set @str= concat('
create table t1(
x int unsigned,
@@ -51,21 +52,28 @@ begin
select x as ALL_x, y from t1 for system_time all;
if engine = 'innodb' then
select x as ASOF2_x, y from t1 for system_time as of transaction @x0;
select x as FROMTO2_x, y from t1 for system_time from transaction 0 to transaction @x1;
select x as BETWAND2_x, y from t1 for system_time between transaction 0 and transaction @x1;
select x as FROMTO2_ext_x, y from t1 for system_time transaction from 0 to @x1;
select x as BETWAND2_ext_x, y from t1 for system_time transaction between 0 and @x1;
select x as ASOF2_x, y from t1 for system_time as of transaction @x0;
select x as FROMTO2_x, y from t1 for system_time from transaction 0 to transaction @x1;
select x as BETWAND2_x, y from t1 for system_time between transaction 0 and transaction @x1;
select x as FROMTO2_ext_x, y from t1 for system_time transaction from 0 to @x1;
select x as BETWAND2_ext_x, y from t1 for system_time transaction between 0 and @x1;
else
select x as ASOF2_x, y from t1 for system_time as of timestamp @t0;
select x as FROMTO2_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as BETWAND2_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
select x as FROMTO2_ext_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as BETWAND2_ext_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
end if;
drop table t1;
end~~
create or replace procedure test_02(
sys_type varchar(255),
engine varchar(255),
fields varchar(255))
create or replace procedure test_02()
begin
declare engine varchar(255) default default_engine();
declare sys_type varchar(255) default sys_datatype();
declare fields varchar(255) default sys_commit_ts('sys_start');
set @str0= concat('(
x int,
y int,
@@ -102,22 +110,13 @@ begin
end~~
delimiter ;~~
call test_01('timestamp(6)', 'myisam', 'sys_start');
call test_01('bigint unsigned', 'innodb', 'vtq_commit_ts(sys_start)');
call test_02('timestamp(6)', 'myisam', 'sys_start');
call test_02('bigint unsigned', 'innodb', 'vtq_commit_ts(sys_start)');
call test_01();
call test_02();
# wildcard expansion on hidden fields.
create table t1(
A int
) with system versioning engine=myisam;
insert into t1 values(1);
select * from t1;
create or replace table t1(
A int
) with system versioning engine=innodb;
) with system versioning;
insert into t1 values(1);
select * from t1;
@@ -151,20 +150,13 @@ drop view vt1;
create or replace table t1(x int) with system versioning;
select * from (t1 as r left join t1 as u using (x)), t1;
# @end should be max timestamp
# @end should be max
create or replace table t1 (a int) with system versioning;
insert into t1 values (1);
create trigger read_end after update on t1
for each row set @end = old.sys_trx_end;
update t1 set a=2;
select @end;
# @end should be max trx_id
create or replace table t1 (a int) with system versioning engine=innodb;
insert into t1 values (1);
create trigger read_end after update on t1
for each row set @end = old.sys_trx_end;
update t1 set a=2;
--replace_result 18446744073709551615 MAX_RESULT "2038-01-19 03:14:07.000000" MAX_RESULT
select @end;
create or replace table t1 (a int) with system versioning;
@@ -183,8 +175,9 @@ select * from t1 for system_time all natural left join t2 for system_time all;
drop table t1, t2;
call verify_vtq;
call innodb_verify_vtq(19);
drop procedure test_01;
drop procedure test_02;
drop procedure verify_vtq;
-- source suite/versioning/common_finish.inc

View File

@@ -263,4 +263,5 @@ drop procedure test_04;
drop procedure test_05;
drop procedure test_06;
drop procedure test_07;
drop procedure verify_vtq;
-- source suite/versioning/common_finish.inc