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
ea347e5b
Commit
ea347e5b
authored
Apr 25, 2005
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for BUG#8921: Make SHOW CREATE VIEW ignore temporary tables.
parent
a0c3aed7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
mysql-test/r/temp_table.result
mysql-test/r/temp_table.result
+26
-0
mysql-test/t/temp_table.test
mysql-test/t/temp_table.test
+15
-0
sql/sql_parse.cc
sql/sql_parse.cc
+4
-0
No files found.
mysql-test/r/temp_table.result
View file @
ea347e5b
...
@@ -97,3 +97,29 @@ Variable_name Value
...
@@ -97,3 +97,29 @@ Variable_name Value
Created_tmp_disk_tables 0
Created_tmp_disk_tables 0
Created_tmp_tables 2
Created_tmp_tables 2
drop table t1;
drop table t1;
create temporary table t1 as select 'This is temp. table' A;
create view t1 as select 'This is view' A;
select * from t1;
A
This is temp. table
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`A` varchar(19) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create view t1;
View Create View
t1 CREATE ALGORITHM=UNDEFINED VIEW `test`.`t1` AS select _latin1'This is view' AS `A`
drop view t1;
select * from t1;
A
This is temp. table
create view t1 as select 'This is view again' A;
select * from t1;
A
This is temp. table
drop table t1;
select * from t1;
A
This is view again
drop view t1;
mysql-test/t/temp_table.test
View file @
ea347e5b
...
@@ -89,3 +89,18 @@ flush status;
...
@@ -89,3 +89,18 @@ flush status;
select
*
from
t1
group
by
d
;
select
*
from
t1
group
by
d
;
show
status
like
"created_tmp%tables"
;
show
status
like
"created_tmp%tables"
;
drop
table
t1
;
drop
table
t1
;
# Fix for BUG#8921: Check that temporary table is ingored by view commands.
create
temporary
table
t1
as
select
'This is temp. table'
A
;
create
view
t1
as
select
'This is view'
A
;
select
*
from
t1
;
show
create
table
t1
;
show
create
view
t1
;
drop
view
t1
;
select
*
from
t1
;
create
view
t1
as
select
'This is view again'
A
;
select
*
from
t1
;
drop
table
t1
;
select
*
from
t1
;
drop
view
t1
;
sql/sql_parse.cc
View file @
ea347e5b
...
@@ -3010,6 +3010,10 @@ unsent_create_error:
...
@@ -3010,6 +3010,10 @@ unsent_create_error:
goto
error
;
goto
error
;
#else
#else
{
{
/* Ignore temporary tables if this is "SHOW CREATE VIEW" */
if
(
lex
->
only_view
)
first_table
->
skip_temporary
=
1
;
if
(
check_db_used
(
thd
,
all_tables
)
||
if
(
check_db_used
(
thd
,
all_tables
)
||
check_access
(
thd
,
SELECT_ACL
|
EXTRA_ACL
,
first_table
->
db
,
check_access
(
thd
,
SELECT_ACL
|
EXTRA_ACL
,
first_table
->
db
,
&
first_table
->
grant
.
privilege
,
0
,
0
))
&
first_table
->
grant
.
privilege
,
0
,
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