Commit 1a01e3b9 authored by unknown's avatar unknown

MDEV-5005: Subquery in Procedure somehow affecting temporary table

Removed unneeded set of TABLE_LIST::skip_temporary flag.
parent 7e4845be
...@@ -416,4 +416,27 @@ MIN(i) ...@@ -416,4 +416,27 @@ MIN(i)
1 1
DROP TABLE t1; DROP TABLE t1;
# End of 5.0 tests # 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; set optimizer_switch=@save_derived_optimizer_switch;
...@@ -320,4 +320,36 @@ DROP TABLE t1; ...@@ -320,4 +320,36 @@ DROP TABLE t1;
--echo # End of 5.0 tests --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; set optimizer_switch=@save_derived_optimizer_switch;
...@@ -3436,10 +3436,7 @@ void SELECT_LEX::mark_as_belong_to_derived(TABLE_LIST *derived) ...@@ -3436,10 +3436,7 @@ void SELECT_LEX::mark_as_belong_to_derived(TABLE_LIST *derived)
TABLE_LIST *tl; TABLE_LIST *tl;
List_iterator<TABLE_LIST> ti(leaf_tables); List_iterator<TABLE_LIST> ti(leaf_tables);
while ((tl= ti++)) while ((tl= ti++))
{
tl->skip_temporary= 1;
tl->belong_to_derived= derived; tl->belong_to_derived= derived;
}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment