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
a37cf525
Commit
a37cf525
authored
Mar 13, 2017
by
kevg
Committed by
Aleksey Midenkov
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: CREATE VIEW with view_list from versioned table [fixes #151]
parent
4782b740
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
mysql-test/suite/versioning/r/view.result
mysql-test/suite/versioning/r/view.result
+2
-0
mysql-test/suite/versioning/t/view.test
mysql-test/suite/versioning/t/view.test
+3
-0
sql/sql_view.cc
sql/sql_view.cc
+17
-4
No files found.
mysql-test/suite/versioning/r/view.result
View file @
a37cf525
...
...
@@ -110,6 +110,8 @@ x
1
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;
...
...
mysql-test/suite/versioning/t/view.test
View file @
a37cf525
...
...
@@ -70,6 +70,9 @@ select * from vt1 for system_time all;
select
*
from
vvt1
for
system_time
all
;
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
;
...
...
sql/sql_view.cc
View file @
a37cf525
...
...
@@ -463,12 +463,25 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
TABLE_SHARE
*
s
=
tl
->
table
->
s
;
if
(
s
->
versioned
)
{
const
char
*
start
=
s
->
vers_start_field
()
->
field_name
;
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
,
s
->
vers_start_field
()
->
field_name
));
thd
,
&
select_lex
->
context
,
NULL
,
NULL
,
start
));
select_lex
->
item_list
.
push_back
(
new
(
thd
->
mem_root
)
Item_field
(
thd
,
&
select_lex
->
context
,
NULL
,
NULL
,
s
->
vers_end_field
()
->
field_name
));
thd
,
&
select_lex
->
context
,
NULL
,
NULL
,
end
));
if
(
lex
->
view_list
.
elements
)
{
if
(
LEX_STRING
*
s
=
thd
->
make_lex_string
(
start
,
strlen
(
start
)))
lex
->
view_list
.
push_back
(
s
);
else
goto
err
;
if
(
LEX_STRING
*
s
=
thd
->
make_lex_string
(
end
,
strlen
(
end
)))
lex
->
view_list
.
push_back
(
s
);
else
goto
err
;
}
}
}
}
...
...
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