1create procedure p1() select 1;
2flush status;
3show status like 'handler_read_key';
4Variable_name	Value
5Handler_read_key	0
6call p1;
71
81
9show status like 'handler_read_key';
10Variable_name	Value
11Handler_read_key	1
12call p1;
131
141
15show status like 'handler_read_key';
16Variable_name	Value
17Handler_read_key	1
18set global stored_program_cache=0;
19call p1;
201
211
22show status like 'handler_read_key';
23Variable_name	Value
24Handler_read_key	2
25call p1;
261
271
28show status like 'handler_read_key';
29Variable_name	Value
30Handler_read_key	3
31drop procedure p1;
32set global stored_program_cache=default;
33create procedure pr(i int) begin
34create table t1 (a int, b int);
35if (i = 1) then alter table t1 drop a;
36else alter table t1 drop b;
37end if;
38select * from t1;
39drop table t1;
40end |
41call pr(1);
42b
43call pr(2);
44ERROR 42S22: Unknown column 'test.t1.b' in 'field list'
45drop table t1;
46set global stored_program_cache=0;
47call pr(1);
48b
49call pr(2);
50a
51drop procedure pr;
52set global stored_program_cache=default;
53