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

Parser: moved 'for system_time' before alias

Due to standard (see 7.6 <table reference>).
This commit is contained in:
Aleksey Midenkov
2017-07-23 17:07:56 +03:00
parent a5ec9fc1b4
commit aa292666cc
9 changed files with 40 additions and 32 deletions

View File

@ -91,12 +91,14 @@ ancestors
as
(
select e.emp_id, e.name, e.mgr
from emp as e for system_time as of timestamp @ts
from emp as e
where name = 'bill'
union
system_time as of timestamp @ts
union
select ee.emp_id, ee.name, ee.mgr
from emp as ee for system_time as of timestamp @ts, ancestors as a for system_time as of timestamp @ts
from emp as ee, ancestors as a
where ee.mgr = a.emp_id
system_time as of timestamp @ts
)
select * from ancestors;
emp_id name mgr
@ -109,12 +111,14 @@ ancestors
as
(
select e.emp_id, e.name, e.mgr
from emp as e for system_time as of timestamp @ts
from emp as e
where name = 'bill'
system_time as of timestamp @ts
union
select ee.emp_id, ee.name, ee.mgr
from emp as ee for system_time as of timestamp @ts, ancestors as a for system_time as of timestamp @ts
from emp as ee, ancestors as a
where ee.mgr = a.emp_id
system_time as of timestamp @ts
)
select * from ancestors";
prepare stmt from @tmp;