-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-7410 Temporary table name conflict between sessions
workaround for missing SP auto-reparse. allow the user to disable stored_program_cache_size, if he wants
- Loading branch information
Sergei Golubchik
committed
Jan 10, 2015
1 parent
0064952
commit 2ab4968
Showing
4 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
mysql-test/suite/sys_vars/r/stored_program_cache_func.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
create procedure p1() select 1; | ||
flush status; | ||
show status like 'handler_read_key'; | ||
Variable_name Value | ||
Handler_read_key 0 | ||
call p1; | ||
1 | ||
1 | ||
show status like 'handler_read_key'; | ||
Variable_name Value | ||
Handler_read_key 1 | ||
call p1; | ||
1 | ||
1 | ||
show status like 'handler_read_key'; | ||
Variable_name Value | ||
Handler_read_key 1 | ||
set global stored_program_cache=0; | ||
call p1; | ||
1 | ||
1 | ||
show status like 'handler_read_key'; | ||
Variable_name Value | ||
Handler_read_key 2 | ||
call p1; | ||
1 | ||
1 | ||
show status like 'handler_read_key'; | ||
Variable_name Value | ||
Handler_read_key 3 | ||
drop procedure p1; | ||
set global stored_program_cache=default; | ||
create procedure pr(i int) begin | ||
create table t1 (a int, b int); | ||
if (i = 1) then alter table t1 drop a; | ||
else alter table t1 drop b; | ||
end if; | ||
select * from t1; | ||
drop table t1; | ||
end | | ||
call pr(1); | ||
b | ||
call pr(2); | ||
ERROR 42S22: Unknown column 'test.t1.b' in 'field list' | ||
drop table t1; | ||
set global stored_program_cache=0; | ||
call pr(1); | ||
b | ||
call pr(2); | ||
a | ||
drop procedure pr; | ||
set global stored_program_cache=default; |
43 changes: 43 additions & 0 deletions
43
mysql-test/suite/sys_vars/t/stored_program_cache_func.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
create procedure p1() select 1; | ||
|
||
flush status; | ||
show status like 'handler_read_key'; | ||
call p1; | ||
show status like 'handler_read_key'; | ||
call p1; | ||
show status like 'handler_read_key'; | ||
|
||
set global stored_program_cache=0; | ||
|
||
call p1; | ||
show status like 'handler_read_key'; | ||
call p1; | ||
show status like 'handler_read_key'; | ||
|
||
drop procedure p1; | ||
set global stored_program_cache=default; | ||
|
||
# Test for missing SP automatic reparsing. | ||
# when MDEV-5816 is implemented, it should be removed. | ||
|
||
--delimiter | | ||
create procedure pr(i int) begin | ||
create table t1 (a int, b int); | ||
if (i = 1) then alter table t1 drop a; | ||
else alter table t1 drop b; | ||
end if; | ||
select * from t1; | ||
drop table t1; | ||
end | | ||
--delimiter ; | ||
call pr(1); | ||
--error ER_BAD_FIELD_ERROR | ||
call pr(2); | ||
drop table t1; | ||
|
||
set global stored_program_cache=0; | ||
call pr(1); | ||
call pr(2); | ||
drop procedure pr; | ||
set global stored_program_cache=default; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters