|
|
@ -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; |