mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
fix parsing of the AS OF clause
This commit is contained in:
@ -107,7 +107,9 @@ create or replace view vt1 as select * from t1 union select * from t2;
|
||||
select * from vt1;
|
||||
a
|
||||
1
|
||||
#
|
||||
# MDEV-14689 crash on second PS execute
|
||||
#
|
||||
create or replace table t1 (a int);
|
||||
create or replace view v1 as select * from t1;
|
||||
create or replace table t2 (b int) with system versioning;
|
||||
@ -119,6 +121,9 @@ a
|
||||
drop database test;
|
||||
create database test;
|
||||
use test;
|
||||
#
|
||||
# MDEV-15146 SQLError[4122]: View is not system versioned
|
||||
#
|
||||
create table t1 (a int) with system versioning;
|
||||
insert t1 values (1),(2);
|
||||
set @a=now(6);
|
||||
@ -133,5 +138,15 @@ a
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
|
||||
#
|
||||
# MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
|
||||
#
|
||||
create or replace table t1 (i int) with system versioning;
|
||||
select * from t1 for system_time as of now() - interval 6 second;
|
||||
i
|
||||
create or replace view v1 as select * from t1 for system_time as of date_sub(now(), interval 6 second);
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` FOR SYSTEM_TIME AS OF current_timestamp() - interval 6 second latin1 latin1_swedish_ci
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user