Debian Codegraph @

mysql-test/suite/sys_vars/t/stored_program_cache_func.test

raw
1 --source include/protocol.inc
2
3 create procedure p1() select 1;
4
5 flush status;
6 show status like 'handler_read_key';
7 call p1;
8 show status like 'handler_read_key';
9 call p1;
10 show status like 'handler_read_key';
11
12 set global stored_program_cache=0;
13
14 call p1;
15 show status like 'handler_read_key';
16 call p1;
17 show status like 'handler_read_key';
18
19 drop procedure p1;
20 set global stored_program_cache=default;
21
22 # Test for missing SP automatic reparsing.
23 # when MDEV-5816 is implemented, it should be removed.
24
25 --delimiter |
26 create procedure pr(i int) begin
27 create table t1 (a int, b int);
28 if (i = 1) then alter table t1 drop a;
29 else alter table t1 drop b;
30 end if;
31 select * from t1;
32 drop table t1;
33 end |
34 --delimiter ;
35 call pr(1);
36 #--error ER_BAD_FIELD_ERROR
37 # MDEV-5816 added support for recompilation of statements
38 # inside a stored routine so the error ER_BAD_FIELD_ERROR is
39 # no more expcted
40 call pr(2);
41
42 set global stored_program_cache=0;
43 call pr(1);
44 call pr(2);
45 drop procedure pr;
46 set global stored_program_cache=default;
47