diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result index 94dcb243e65..da8cb25340e 100644 --- a/mysql-test/suite/versioning/r/select.result +++ b/mysql-test/suite/versioning/r/select.result @@ -42,15 +42,30 @@ insert into t1 (x, y) values (8, 108), (9, 109); set @t0= now(6); +if engine = 'innodb' then +select sys_start from t1 limit 1 into @x0; +end if; delete from t1 where x = 3; delete from t1 where x > 7; insert into t1(x, y) values(3, 33); -set @str= concat('select ', fields, ' from t1 where x = 3 and y = 33 into @t1'); -prepare stmt from @str; execute stmt; drop prepare stmt; +select sys_start from t1 where x = 3 and y = 33 into @t1; +if engine = 'innodb' then +set @x1= @t1; +select commit_ts(@x1) into @t1; +end if; select x, y from t1; -select x as AS_OF_x, y from t1 for system_time as of timestamp @t0; -select x as FROM_TO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1; -select x as BETWEEN_AND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1; +select x as ASOF_x, y from t1 for system_time as of timestamp @t0; +select x as FROMTO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1; +select x as BETWAND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1; +select x as FROMTO_ext_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1; +select x as BETWAND_ext_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1; +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; +end if; drop table t1; end~~ create or replace procedure test_02( @@ -97,7 +112,7 @@ x y 6 106 7 107 3 33 -AS_OF_x y +ASOF_x y 0 100 1 101 2 102 @@ -108,7 +123,7 @@ AS_OF_x y 7 107 8 108 9 109 -FROM_TO_x y +FROMTO_x y 0 100 1 101 2 102 @@ -119,7 +134,30 @@ FROM_TO_x y 7 107 8 108 9 109 -BETWEEN_AND_x y +BETWAND_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +3 33 +FROMTO_ext_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +BETWAND_ext_x y 0 100 1 101 2 102 @@ -141,7 +179,7 @@ x y 6 106 7 107 3 33 -AS_OF_x y +ASOF_x y 0 100 1 101 2 102 @@ -152,7 +190,7 @@ AS_OF_x y 7 107 8 108 9 109 -FROM_TO_x y +FROMTO_x y 0 100 1 101 2 102 @@ -163,7 +201,87 @@ FROM_TO_x y 7 107 8 108 9 109 -BETWEEN_AND_x y +BETWAND_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +3 33 +FROMTO_ext_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +BETWAND_ext_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +3 33 +ASOF2_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +FROMTO2_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +BETWAND2_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +3 33 +FROMTO2_ext_x y +0 100 +1 101 +2 102 +3 103 +4 104 +5 105 +6 106 +7 107 +8 108 +9 109 +BETWAND2_ext_x y 0 100 1 101 2 102 diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test index 0aa4f561882..6c586ccd868 100644 --- a/mysql-test/suite/versioning/t/select.test +++ b/mysql-test/suite/versioning/t/select.test @@ -28,16 +28,34 @@ begin (8, 108), (9, 109); set @t0= now(6); + if engine = 'innodb' then + select sys_start from t1 limit 1 into @x0; + end if; + delete from t1 where x = 3; delete from t1 where x > 7; insert into t1(x, y) values(3, 33); - set @str= concat('select ', fields, ' from t1 where x = 3 and y = 33 into @t1'); - prepare stmt from @str; execute stmt; drop prepare stmt; + select sys_start from t1 where x = 3 and y = 33 into @t1; + if engine = 'innodb' then + set @x1= @t1; + select commit_ts(@x1) into @t1; + end if; + select x, y from t1; - select x as AS_OF_x, y from t1 for system_time as of timestamp @t0; - select x as FROM_TO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1; - select x as BETWEEN_AND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1; + select x as ASOF_x, y from t1 for system_time as of timestamp @t0; + select x as FROMTO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1; + select x as BETWAND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1; + select x as FROMTO_ext_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1; + select x as BETWAND_ext_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1; + + 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; + end if; drop table t1; end~~