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
695c5aab
Commit
695c5aab
authored
Dec 09, 2016
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: error on FOR SYSTEM_TIME without any versioned tables
[fixes #88]
parent
1bedafb7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
7 deletions
+22
-7
mysql-test/suite/versioning/r/select.result
mysql-test/suite/versioning/r/select.result
+4
-0
mysql-test/suite/versioning/t/select.test
mysql-test/suite/versioning/t/select.test
+6
-2
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+2
-2
sql/sql_select.cc
sql/sql_select.cc
+10
-3
No files found.
mysql-test/suite/versioning/r/select.result
View file @
695c5aab
...
...
@@ -398,6 +398,10 @@ insert into t1 values(1);
select * from t1;
A
1
create or replace table t1 (x int);
insert into t1 values (1);
select * from t1 for system_time all;
ERROR HY000: System Versioning required: `FOR SYSTEM_TIME` query
drop table t1;
call verify_vtq;
No A B C D
...
...
mysql-test/suite/versioning/t/select.test
View file @
695c5aab
...
...
@@ -108,7 +108,7 @@ call test_01('bigint unsigned', 'innodb', 'vtq_commit_ts(sys_start)');
call
test_02
(
'timestamp(6)'
,
'myisam'
,
'sys_start'
);
call
test_02
(
'bigint unsigned'
,
'innodb'
,
'vtq_commit_ts(sys_start)'
);
#
Test
wildcard expansion on hidden fields.
# wildcard expansion on hidden fields.
create
table
t1
(
A
int
)
with
system
versioning
engine
=
myisam
;
...
...
@@ -121,8 +121,12 @@ create or replace table t1(
insert
into
t1
values
(
1
);
select
*
from
t1
;
create
or
replace
table
t1
(
x
int
);
insert
into
t1
values
(
1
);
--
error
ER_VERSIONING_REQUIRED
select
*
from
t1
for
system_time
all
;
drop
table
t1
;
# End test wildcard expansion.
call
verify_vtq
;
...
...
sql/share/errmsg-utf8.txt
View file @
695c5aab
...
...
@@ -7487,8 +7487,8 @@ ER_UNKNOWN_VIEW 42S02
# MariaDB error numbers related to System Versioning
ER_
TABLE_DOESNT_SUPPORT_SYSTEM_VERSIONING
eng "
Table %`s doesn't support system versioning
"
ER_
VERSIONING_REQUIRED
eng "
System Versioning required: %s
"
ER_VERS_READONLY_FIELD
eng "System field %`s is read-only"
...
...
sql/sql_select.cc
View file @
695c5aab
...
...
@@ -668,9 +668,9 @@ setup_without_group(THD *thd, Ref_ptr_array ref_pointer_array,
}
static
int
setup_for_system_time
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
**
where_expr
,
SELECT_LEX
*
slex
)
vers_setup_select
(
THD
*
thd
,
TABLE_LIST
*
tables
,
COND
**
where_expr
,
SELECT_LEX
*
slex
)
{
DBUG_ENTER
(
"
setup_for_system_time
"
);
DBUG_ENTER
(
"
vers_setup_select
"
);
#define newx new (thd->mem_root)
TABLE_LIST
*
table
;
...
...
@@ -693,7 +693,14 @@ setup_for_system_time(THD *thd, TABLE_LIST *tables, COND **where_expr, SELECT_LE
}
if
(
versioned_tables
==
0
)
{
if
(
slex
->
vers_conditions
.
type
!=
FOR_SYSTEM_TIME_UNSPECIFIED
)
{
my_error
(
ER_VERSIONING_REQUIRED
,
MYF
(
0
),
"`FOR SYSTEM_TIME` query"
);
DBUG_RETURN
(
-
1
);
}
DBUG_RETURN
(
0
);
}
/* For prepared statements we create items on statement arena,
because they must outlive execution phase for multiple executions. */
...
...
@@ -980,7 +987,7 @@ JOIN::prepare(TABLE_LIST *tables_init,
}
/* Handle FOR SYSTEM_TIME clause. */
if
(
setup_for_system_time
(
thd
,
tables_list
,
&
conds
,
select_lex
)
<
0
)
if
(
vers_setup_select
(
thd
,
tables_list
,
&
conds
,
select_lex
)
<
0
)
DBUG_RETURN
(
-
1
);
/*
...
...
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