Debian Codegraph @

mysql-test/suite/perfschema/t/query_cache.test

raw
1 # Tests for PERFORMANCE_SCHEMA
2
3 # This test verifies that performance schema tables, because they contain
4 # data that is volatile, are never cached in the query cache.
5
6 --source include/have_query_cache.inc
7 --source include/not_embedded.inc
8 --source include/have_perfschema.inc
9
10 set @save_query_cache_size=@@query_cache_size;
11
12 --disable_warnings
13 drop table if exists t1;
14 --enable_warnings
15
16 create table t1 (a int not null);
17 insert into t1 values (1), (2), (3);
18
19 SET GLOBAL query_cache_size=1355776;
20
21 flush query cache;
22 reset query cache;
23 flush global status;
24
25 --disable_ps2_protocol
26 --disable_cursor_protocol
27 select * from t1;
28 --enable_cursor_protocol
29
30 show global status like "Qcache_queries_in_cache";
31 show global status like "Qcache_inserts";
32 show global status like "Qcache_hits";
33
34 --disable_cursor_protocol
35 select * from t1;
36 --enable_cursor_protocol
37
38 show global status like "Qcache_queries_in_cache";
39 show global status like "Qcache_inserts";
40 show global status like "Qcache_hits";
41
42 select spins from performance_schema.events_waits_current order by event_name limit 1;
43
44 --replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND}
45 select * from performance_schema.setup_timers where name='wait';
46
47 show global status like "Qcache_queries_in_cache";
48 show global status like "Qcache_inserts";
49 show global status like "Qcache_hits";
50
51 select spins from performance_schema.events_waits_current order by event_name limit 1;
52
53 --replace_result CYCLE {CYCLE_OR_NANOSECOND} NANOSECOND {CYCLE_OR_NANOSECOND}
54 select * from performance_schema.setup_timers where name='wait';
55 --enable_ps2_protocol
56
57 show global status like "Qcache_queries_in_cache";
58 show global status like "Qcache_inserts";
59 show global status like "Qcache_hits";
60
61 SET GLOBAL query_cache_size=@save_query_cache_size;
62
63 drop table t1;
64 flush global status;
65