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
4ebf680c
Commit
4ebf680c
authored
Mar 14, 2017
by
kevg
Committed by
Aleksey Midenkov
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: VIEW over a JOIN of versioned tables [fixes #153]
parent
92c7a871
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
mysql-test/suite/versioning/r/view.result
mysql-test/suite/versioning/r/view.result
+13
-4
mysql-test/suite/versioning/t/view.test
mysql-test/suite/versioning/t/view.test
+11
-4
sql/sql_view.cc
sql/sql_view.cc
+2
-2
No files found.
mysql-test/suite/versioning/r/view.result
View file @
4ebf680c
...
...
@@ -112,7 +112,16 @@ select * from vvvt1 for system_time all;
x
create or replace table t1 (x int) with system versioning;
create or replace view vt1(c) as select x from t1;
drop view vvvt1;
drop view vvt1;
drop view vt1;
drop table t1;
create or replace table t1 (a int) with system versioning;
create or replace table t2 (b int) with system versioning;
insert into t1 values (1);
insert into t2 values (2);
create or replace view vt12 as select * from t1 cross join t2;
select * from vt12;
a b
1 2
create or replace view vt12 as select * from t1 for system_time as of timestamp '0-0-0' cross join t2;
select * from vt12;
a b
drop view vt1, vvt1, vvvt1, vt12;
drop table t1, t2;
mysql-test/suite/versioning/t/view.test
View file @
4ebf680c
...
...
@@ -73,7 +73,14 @@ select * from vvvt1 for system_time all;
create
or
replace
table
t1
(
x
int
)
with
system
versioning
;
create
or
replace
view
vt1
(
c
)
as
select
x
from
t1
;
drop
view
vvvt1
;
drop
view
vvt1
;
drop
view
vt1
;
drop
table
t1
;
create
or
replace
table
t1
(
a
int
)
with
system
versioning
;
create
or
replace
table
t2
(
b
int
)
with
system
versioning
;
insert
into
t1
values
(
1
);
insert
into
t2
values
(
2
);
create
or
replace
view
vt12
as
select
*
from
t1
cross
join
t2
;
select
*
from
vt12
;
create
or
replace
view
vt12
as
select
*
from
t1
for
system_time
as
of
timestamp
'0-0-0'
cross
join
t2
;
select
*
from
vt12
;
drop
view
vt1
,
vvt1
,
vvvt1
,
vt12
;
drop
table
t1
,
t2
;
sql/sql_view.cc
View file @
4ebf680c
...
...
@@ -467,9 +467,9 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
const
char
*
end
=
s
->
vers_end_field
()
->
field_name
;
select_lex
->
item_list
.
push_back
(
new
(
thd
->
mem_root
)
Item_field
(
thd
,
&
select_lex
->
context
,
NULL
,
NULL
,
start
));
thd
,
&
select_lex
->
context
,
tables
->
db
,
tables
->
alias
,
start
));
select_lex
->
item_list
.
push_back
(
new
(
thd
->
mem_root
)
Item_field
(
thd
,
&
select_lex
->
context
,
NULL
,
NULL
,
end
));
thd
,
&
select_lex
->
context
,
tables
->
db
,
tables
->
alias
,
end
));
if
(
lex
->
view_list
.
elements
)
{
...
...
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