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
This commit is contained in:
parent
00649525ee
commit
2ab49689c6
@ -23,7 +23,7 @@ Warnings:
|
||||
Warning 1292 Truncated incorrect stored_program_cache value: '-1'
|
||||
SELECT @@global.stored_program_cache;
|
||||
@@global.stored_program_cache
|
||||
256
|
||||
0
|
||||
SET @@global.stored_program_cache =100000000000;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect stored_program_cache value: '100000000000'
|
||||
@ -31,11 +31,9 @@ SELECT @@global.stored_program_cache;
|
||||
@@global.stored_program_cache
|
||||
524288
|
||||
SET @@global.stored_program_cache = 0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect stored_program_cache value: '0'
|
||||
SELECT @@global.stored_program_cache;
|
||||
@@global.stored_program_cache
|
||||
256
|
||||
0
|
||||
SET @@global.stored_program_cache = 10000.01;
|
||||
ERROR 42000: Incorrect argument type to variable 'stored_program_cache'
|
||||
SET @@global.stored_program_cache = ON;
|
||||
|
52
mysql-test/suite/sys_vars/r/stored_program_cache_func.result
Normal file
52
mysql-test/suite/sys_vars/r/stored_program_cache_func.result
Normal file
@ -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
mysql-test/suite/sys_vars/t/stored_program_cache_func.test
Normal file
43
mysql-test/suite/sys_vars/t/stored_program_cache_func.test
Normal file
@ -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;
|
||||
|
@ -3679,7 +3679,7 @@ static Sys_var_ulong Sys_sp_cache_size(
|
||||
"The soft upper limit for number of cached stored routines for "
|
||||
"one connection.",
|
||||
GLOBAL_VAR(stored_program_cache_size), CMD_LINE(REQUIRED_ARG),
|
||||
VALID_RANGE(256, 512 * 1024), DEFAULT(256), BLOCK_SIZE(1));
|
||||
VALID_RANGE(0, 512 * 1024), DEFAULT(256), BLOCK_SIZE(1));
|
||||
|
||||
export const char *plugin_maturity_names[]=
|
||||
{ "unknown", "experimental", "alpha", "beta", "gamma", "stable", 0 };
|
||||
|
Loading…
x
Reference in New Issue
Block a user