1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

SQL: system_time propagation from derived table [fixes #228]

This commit is contained in:
Aleksey Midenkov
2017-07-12 10:36:02 +03:00
parent dcb54040bc
commit 60e456df33
6 changed files with 88 additions and 14 deletions

View File

@ -139,10 +139,22 @@ ERROR HY000: Derived table is prohibited: system fields from multiple tables `t1
select * from (select * from t1 for system_time as of timestamp @t0, t2) as s0;
x y
1 10
select * from (select *, t1.sys_trx_end from t2, t1 for system_time as of timestamp @t0) as s0;
with s1 as (select * from t1 for system_time as of timestamp @t0, t2) select * from s1;
x y
1 10
select * from (select *, t1.sys_trx_end from t2, t1 for system_time as of timestamp @t0) as s2;
y x
10 1
select * from (select *, t1.sys_trx_start from t2 for system_time as of now, t1) as s0 query for system_time as of timestamp @t0;
with s3 as (select *, t1.sys_trx_end from t2, t1 for system_time as of timestamp @t0) select * from s3;
y x
10 1
select * from (select *, t1.sys_trx_start from t2 for system_time as of now, t1) as s4 query for system_time as of timestamp @t0;
y x
10 1
with s5 as (select *, t1.sys_trx_start from t2 for system_time as of now, t1) select * from s5 for system_time as of timestamp @t0;
y x
10 1
with s6 as (select *, t1.sys_trx_start from t2 for system_time as of now, t1) select * from s6 query for system_time as of timestamp @t0;
y x
10 1
set @q= concat("create view vt1 as select * from t1 for system_time as of timestamp '", @t0, "'");