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
7a22dd37
Commit
7a22dd37
authored
Mar 06, 2017
by
kevg
Committed by
Aleksey Midenkov
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: INNER JOIN USING with versioned tables [fixes #147]
parent
9355e3e9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
mysql-test/suite/versioning/r/select.result
mysql-test/suite/versioning/r/select.result
+10
-1
mysql-test/suite/versioning/t/select.test
mysql-test/suite/versioning/t/select.test
+9
-1
sql/sql_base.cc
sql/sql_base.cc
+1
-1
No files found.
mysql-test/suite/versioning/r/select.result
View file @
7a22dd37
...
...
@@ -409,7 +409,16 @@ ERROR HY000: Wrong parameters for `FOR SYSTEM_TIME query`: write-locking of hist
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
a
drop table t1;
create or replace table t1 (a int) with system versioning;
create or replace table t2 (a int) with system versioning;
insert into t1 values(1);
insert into t2 values(1);
create view v1 as select * from t2 inner join t1 using (a);
select * from v1;
a
1
drop view v1;
drop table t1, t2;
call verify_vtq;
No A B C D
1 1 1 1 1
...
...
mysql-test/suite/versioning/t/select.test
View file @
7a22dd37
...
...
@@ -134,7 +134,15 @@ select * from t1 for system_time all for update;
create
or
replace
table
t1
(
a
int
not
null
auto_increment
primary
key
)
with
system
versioning
;
select
*
from
(
t1
as
t2
left
join
t1
as
t3
using
(
a
))
natural
left
join
t1
;
drop
table
t1
;
create
or
replace
table
t1
(
a
int
)
with
system
versioning
;
create
or
replace
table
t2
(
a
int
)
with
system
versioning
;
insert
into
t1
values
(
1
);
insert
into
t2
values
(
1
);
create
view
v1
as
select
*
from
t2
inner
join
t1
using
(
a
);
select
*
from
v1
;
drop
view
v1
;
drop
table
t1
,
t2
;
call
verify_vtq
;
...
...
sql/sql_base.cc
View file @
7a22dd37
...
...
@@ -5350,7 +5350,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
{
if
(
!
my_strcasecmp
(
system_charset_info
,
curr_nj_col
->
name
(),
name
))
{
if
(
nj_col
)
if
(
nj_col
&&
!
curr_nj_col
->
table_field
->
field
->
vers_sys_field
()
)
{
my_error
(
ER_NON_UNIQ_ERROR
,
MYF
(
0
),
name
,
thd
->
where
);
DBUG_RETURN
(
NULL
);
...
...
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