mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-5535: Cannot reopen temporary table
Temporary table being created by outer statement should not be visible to inner statement. And if inner statement creates a table with same name. The whole statement should fail with ER_TABLE_EXISTS_ERROR. Implemented by temporarily de-linking the TABLE_SHARE being created by outer statement so that it remains hidden to the inner statement.
This commit is contained in:
@ -1524,14 +1524,14 @@ drop temporary table t1;
|
||||
return 1;
|
||||
end|
|
||||
create temporary table t1 as select f1();
|
||||
ERROR HY000: Can't reopen table: 't1'
|
||||
ERROR 42S02: Unknown table 'test.t1'
|
||||
create function f2() returns int
|
||||
begin
|
||||
create temporary table t2 as select f1();
|
||||
return 1;
|
||||
end|
|
||||
create temporary table t1 as select f2();
|
||||
ERROR HY000: Can't reopen table: 't1'
|
||||
ERROR 42S02: Unknown table 'test.t1'
|
||||
drop function f1;
|
||||
drop function f2;
|
||||
create function f1() returns int
|
||||
@ -1545,7 +1545,7 @@ create temporary table t2 as select f1();
|
||||
return 1;
|
||||
end|
|
||||
create temporary table t1 as select f2();
|
||||
ERROR HY000: Can't reopen table: 't2'
|
||||
ERROR 42S02: Unknown table 'test.t2,test.t1'
|
||||
drop function f1;
|
||||
drop function f2;
|
||||
create temporary table t2(a int);
|
||||
|
Reference in New Issue
Block a user