|
|
|
@@ -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
|
|
|
|
|