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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5e0fa378
Commit
5e0fa378
authored
Aug 24, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes name outout for SHOW CREATE VIEW command (BUG#5162)
parent
94bfede7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
mysql-test/r/view.result
mysql-test/r/view.result
+17
-12
mysql-test/t/view.test
mysql-test/t/view.test
+7
-0
sql/sql_show.cc
sql/sql_show.cc
+2
-2
No files found.
mysql-test/r/view.result
View file @
5e0fa378
...
...
@@ -32,10 +32,10 @@ c
11
show create table v1;
Table Create Table
v1 CREATE VIEW
test.v1
AS select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1`
v1 CREATE VIEW
`test`.`v1`
AS select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1`
show create view v1;
Table Create Table
v1 CREATE VIEW
test.v1
AS select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1`
v1 CREATE VIEW
`test`.`v1`
AS select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1`
show create view t1;
ERROR HY000: 'test.t1' is not VIEW
drop table t1;
...
...
@@ -55,7 +55,7 @@ Note 1003 select (`test`.`t1`.`b` + 1) AS `c` from `test`.`v1`
create algorithm=temptable view v2 (c) as select b+1 from t1;
show create table v2;
Table Create Table
v2 CREATE ALGORITHM=TMPTABLE VIEW
test.v2
AS select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1`
v2 CREATE ALGORITHM=TMPTABLE VIEW
`test`.`v2`
AS select (`test`.`t1`.`b` + 1) AS `c` from `test`.`t1`
select c from v2;
c
3
...
...
@@ -306,14 +306,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
show create table mysqltest.v1;
Table Create Table
v1 CREATE VIEW
mysqltest.v1
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
v1 CREATE VIEW
`mysqltest`.`v1`
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
explain select c from mysqltest.v2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
show create table mysqltest.v2;
Table Create Table
v2 CREATE ALGORITHM=TMPTABLE VIEW
mysqltest.v2
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
v2 CREATE ALGORITHM=TMPTABLE VIEW
`mysqltest`.`v2`
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
explain select c from mysqltest.v3;
ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create table mysqltest.v3;
...
...
@@ -328,27 +328,27 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
show create table mysqltest.v1;
Table Create Table
v1 CREATE VIEW
mysqltest.v1
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
v1 CREATE VIEW
`mysqltest`.`v1`
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
explain select c from mysqltest.v2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
show create table mysqltest.v2;
Table Create Table
v2 CREATE ALGORITHM=TMPTABLE VIEW
mysqltest.v2
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
v2 CREATE ALGORITHM=TMPTABLE VIEW
`mysqltest`.`v2`
AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1`
explain select c from mysqltest.v3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 0 const row not found
show create table mysqltest.v3;
Table Create Table
v3 CREATE VIEW
mysqltest.v3
AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2`
v3 CREATE VIEW
`mysqltest`.`v3`
AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2`
explain select c from mysqltest.v4;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
show create table mysqltest.v4;
Table Create Table
v4 CREATE ALGORITHM=TMPTABLE VIEW
mysqltest.v4
AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2`
v4 CREATE ALGORITHM=TMPTABLE VIEW
`mysqltest`.`v4`
AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2`
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
drop database mysqltest;
...
...
@@ -946,7 +946,7 @@ create table t1 ("a*b" int);
create view v1 as select "a*b" from t1;
show create view v1;
Table Create Table
v1 CREATE VIEW
test.v1
AS select `test`.`t1`.`a*b` AS `a*b` from `test`.`t1`
v1 CREATE VIEW
"test"."v1"
AS select `test`.`t1`.`a*b` AS `a*b` from `test`.`t1`
drop view v1;
drop table t1;
set sql_mode=default;
...
...
@@ -1055,7 +1055,7 @@ drop table t1;
CREATE VIEW v1 (f1,f2,f3,f4) AS SELECT connection_id(), pi(), current_user(), version();
SHOW CREATE VIEW v1;
Table Create Table
v1 CREATE VIEW
test.v1
AS select sql_no_cache connection_id() AS `f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4`
v1 CREATE VIEW
`test`.`v1`
AS select sql_no_cache connection_id() AS `f1`,pi() AS `f2`,current_user() AS `f3`,version() AS `f4`
drop view v1;
create table t1 (s1 int);
create table t2 (s2 int);
...
...
@@ -1089,6 +1089,11 @@ create view v1 as select a from t1;
create view v2 as select a from t2 where a in (select a from v1);
show create view v2;
Table Create Table
v2 CREATE VIEW
test.v2
AS select `test`.`t2`.`a` AS `a` from `test`.`t2` where `a` in (select `v1`.`a` AS `a` from `test`.`v1`)
v2 CREATE VIEW
`test`.`v2`
AS select `test`.`t2`.`a` AS `a` from `test`.`t2` where `a` in (select `v1`.`a` AS `a` from `test`.`v1`)
drop view v2, v1;
drop table t1, t2;
CREATE VIEW `v 1` AS select 5 AS `5`;
show create view `v 1`;
Table Create Table
v 1 CREATE VIEW `test`.`v 1` AS select 5 AS `5`
drop view `v 1`;
mysql-test/t/view.test
View file @
5e0fa378
...
...
@@ -1038,3 +1038,10 @@ create view v2 as select a from t2 where a in (select a from v1);
show
create
view
v2
;
drop
view
v2
,
v1
;
drop
table
t1
,
t2
;
#
# SHOW VIEW view with name with spaces
#
CREATE
VIEW
`v 1`
AS
select
5
AS
`5`
;
show
create
view
`v 1`
;
drop
view
`v 1`
;
sql/sql_show.cc
View file @
5e0fa378
...
...
@@ -1575,9 +1575,9 @@ view_store_create_info(THD *thd, TABLE_LIST *table, String *buff)
buff
->
append
(
"MERGE "
,
6
);
}
buff
->
append
(
"VIEW "
,
5
);
buff
->
append
(
table
->
view_db
.
str
,
table
->
view_db
.
length
);
append_identifier
(
thd
,
buff
,
table
->
view_db
.
str
,
table
->
view_db
.
length
);
buff
->
append
(
'.'
);
buff
->
append
(
table
->
view_name
.
str
,
table
->
view_name
.
length
);
append_identifier
(
thd
,
buff
,
table
->
view_name
.
str
,
table
->
view_name
.
length
);
buff
->
append
(
" AS "
,
4
);
buff
->
append
(
table
->
query
.
str
,
table
->
query
.
length
);
return
0
;
...
...
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