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
1a01e3b9
Commit
1a01e3b9
authored
Sep 12, 2013
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5005: Subquery in Procedure somehow affecting temporary table
Removed unneeded set of TABLE_LIST::skip_temporary flag.
parent
7e4845be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
3 deletions
+55
-3
mysql-test/r/derived.result
mysql-test/r/derived.result
+23
-0
mysql-test/t/derived.test
mysql-test/t/derived.test
+32
-0
sql/sql_lex.cc
sql/sql_lex.cc
+0
-3
No files found.
mysql-test/r/derived.result
View file @
1a01e3b9
...
...
@@ -416,4 +416,27 @@ MIN(i)
1
DROP TABLE t1;
# End of 5.0 tests
#
# MDEV-5005: Subquery in Procedure somehow affecting temporary table
#
create temporary table if not exists t1 (id int not null);
select A.* from ( select tt.* from t1 tt ) A;
id
prepare stmt from "select A.* from ( select tt.* from t1 tt ) A ";
execute stmt;
id
deallocate prepare stmt;
drop temporary table t1;
CREATE PROCEDURE p ()
BEGIN
select A.* from ( select tt.* from t1 tt ) A ;
END |
create temporary table if not exists t1 (id int not null);
CALL p();
id
CALL p();
id
drop procedure p;
drop temporary table t1;
# End of 5.3 tests
set optimizer_switch=@save_derived_optimizer_switch;
mysql-test/t/derived.test
View file @
1a01e3b9
...
...
@@ -320,4 +320,36 @@ DROP TABLE t1;
--
echo
# End of 5.0 tests
--
echo
#
--
echo
# MDEV-5005: Subquery in Procedure somehow affecting temporary table
--
echo
#
create
temporary
table
if
not
exists
t1
(
id
int
not
null
);
select
A
.*
from
(
select
tt
.*
from
t1
tt
)
A
;
prepare
stmt
from
"select A.* from ( select tt.* from t1 tt ) A "
;
execute
stmt
;
deallocate
prepare
stmt
;
drop
temporary
table
t1
;
--
delimiter
|
CREATE
PROCEDURE
p
()
BEGIN
select
A
.*
from
(
select
tt
.*
from
t1
tt
)
A
;
END
|
--
delimiter
;
create
temporary
table
if
not
exists
t1
(
id
int
not
null
);
CALL
p
();
CALL
p
();
drop
procedure
p
;
drop
temporary
table
t1
;
--
echo
# End of 5.3 tests
set
optimizer_switch
=@
save_derived_optimizer_switch
;
sql/sql_lex.cc
View file @
1a01e3b9
...
...
@@ -3436,10 +3436,7 @@ void SELECT_LEX::mark_as_belong_to_derived(TABLE_LIST *derived)
TABLE_LIST
*
tl
;
List_iterator
<
TABLE_LIST
>
ti
(
leaf_tables
);
while
((
tl
=
ti
++
))
{
tl
->
skip_temporary
=
1
;
tl
->
belong_to_derived
=
derived
;
}
}
...
...
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