Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1a86fc5f
Commit
1a86fc5f
authored
Mar 03, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
fix parsing of the AS OF clause
parent
bb56a06d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
+32
-9
mysql-test/suite/versioning/r/view.result
mysql-test/suite/versioning/r/view.result
+15
-0
mysql-test/suite/versioning/t/view.test
mysql-test/suite/versioning/t/view.test
+14
-4
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-5
No files found.
mysql-test/suite/versioning/r/view.result
View file @
1a86fc5f
...
...
@@ -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;
mysql-test/suite/versioning/t/view.test
View file @
1a86fc5f
...
...
@@ -89,7 +89,9 @@ create or replace table t2 (a int);
create
or
replace
view
vt1
as
select
*
from
t1
union
select
*
from
t2
;
select
*
from
vt1
;
--
echo
#
--
echo
# MDEV-14689 crash on second PS execute
--
echo
#
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
;
...
...
@@ -100,10 +102,9 @@ drop database test;
create
database
test
;
use
test
;
#
# MDEV-15146 SQLError[4122]: View is not system versioned
#
--
echo
#
--
echo
# MDEV-15146 SQLError[4122]: View is not system versioned
--
echo
#
create
table
t1
(
a
int
)
with
system
versioning
;
insert
t1
values
(
1
),(
2
);
set
@
a
=
now
(
6
);
...
...
@@ -112,5 +113,14 @@ delete from t1;
select
*
from
v1
;
select
*
from
v1
for
system_time
as
of
@
a
;
show
create
view
v1
;
--
echo
#
--
echo
# MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
--
echo
#
create
or
replace
table
t1
(
i
int
)
with
system
versioning
;
select
*
from
t1
for
system_time
as
of
now
()
-
interval
6
second
;
create
or
replace
view
v1
as
select
*
from
t1
for
system_time
as
of
date_sub
(
now
(),
interval
6
second
);
show
create
view
v1
;
drop
view
v1
;
drop
table
t1
;
sql/sql_yacc.yy
View file @
1a86fc5f
...
...
@@ -9229,7 +9229,7 @@ history_point:
{
$$= Vers_history_point(VERS_TIMESTAMP, $1);
}
| opt_history_unit
simple
_expr
| opt_history_unit
bit
_expr
{
$$= Vers_history_point($1, $2);
}
...
...
@@ -9255,13 +9255,11 @@ system_time_expr:
{
Lex->vers_conditions.init(SYSTEM_TIME_ALL);
}
| FROM history_point
TO_SYM history_point
| FROM history_point TO_SYM history_point
{
Lex->vers_conditions.init(SYSTEM_TIME_FROM_TO, $2, $4);
}
| BETWEEN_SYM history_point
AND_SYM history_point
| BETWEEN_SYM history_point AND_SYM history_point
{
Lex->vers_conditions.init(SYSTEM_TIME_BETWEEN, $2, $4);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment