1** Setup **
2
3SET @global_query_cache_limit = @@global.query_cache_limit;
4SET @global_query_cache_size = @@global.query_cache_size;
5SET @global_query_cache_type = @@global.query_cache_type;
6SET GLOBAL query_cache_type= ON;
7SET LOCAL query_cache_type= ON;
8** warnings **
9DROP TABLE IF EXISTS t;
10** creating table **
11CREATE TABLE t
12(
13id INT AUTO_INCREMENT PRIMARY KEY,
14c TEXT(30)
15);
16**inserting value **
17INSERT INTO t set c = repeat('x',29);
18INSERT INTO t set c = concat(repeat('x',28),'r','x');
19INSERT INTO t set c = concat(repeat('x',28),'s','y');
20INSERT INTO t set c = concat(repeat('x',28),'g','w');
21** Reset cache values **
22FLUSH STATUS;
23RESET QUERY CACHE;
24** On query_cache_type **
25SET GLOBAL query_cache_type = ON;
26** Allocating cache size **
27SET GLOBAL query_cache_size = 131072;
28** Reset values
29SET GLOBAL query_cache_size = 0;
30SET GLOBAL query_cache_size = 131072;
31SET GLOBAL query_cache_type = ON;
32'#---------------------FN_DYNVARS_132_01----------------------#'
33** Reset cache values **
34FLUSH STATUS;
35RESET QUERY CACHE;
36** fetching results **
37SELECT * FROM t;
38id	c
391	xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
402	xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
413	xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
424	xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
43** check status on not setting query_cache_limit value **
44SHOW STATUS LIKE 'Qcache_not_cached';
45Variable_name	Value
46Qcache_not_cached	0
47SHOW STATUS LIKE 'Qcache_queries_in_cache';
48Variable_name	Value
49Qcache_queries_in_cache	1
50'#---------------------FN_DYNVARS_132_02----------------------#'
51** Reset cache values **
52FLUSH STATUS;
53RESET QUERY CACHE;
54** set cache limit **
55SET @@GLOBAL.query_cache_limit = 0;
56** fetching results **
57SELECT * FROM t;
58id	c
591	xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
602	xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
613	xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
624	xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
63** Check status after setting value **
64SHOW STATUS LIKE 'Qcache_not_cached';
65Variable_name	Value
66Qcache_not_cached	1
671 Expected
68SHOW STATUS LIKE 'Qcache_queries_in_cache';
69Variable_name	Value
70Qcache_queries_in_cache	0
710 Expected
72'#---------------------FN_DYNVARS_132_03----------------------#'
73** set cache limit **
74SET @@GLOBAL.query_cache_limit = DEFAULT;
75** Reset cache values **
76FLUSH STATUS;
77RESET QUERY CACHE;
78** fetching results **
79SELECT * FROM t;
80id	c
811	xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
822	xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
833	xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
844	xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
85SHOW STATUS LIKE 'Qcache_not_cached';
86Variable_name	Value
87Qcache_not_cached	0
880 Expected
89SHOW STATUS LIKE 'Qcache_queries_in_cache';
90Variable_name	Value
91Qcache_queries_in_cache	1
921 Expected
93SET @@GLOBAL.query_cache_limit = 0;
94SHOW STATUS LIKE 'Qcache_not_cached';
95Variable_name	Value
96Qcache_not_cached	0
970 Expected
98SHOW STATUS LIKE 'Qcache_queries_in_cache';
99Variable_name	Value
100Qcache_queries_in_cache	1
1011 Expected
102** fetching results **
103SELECT * FROM t;
104id	c
1051	xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1062	xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
1073	xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
1084	xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
109** Check status after setting value **
110SHOW STATUS LIKE 'Qcache_not_cached';
111Variable_name	Value
112Qcache_not_cached	0
1130 Expected
114SHOW STATUS LIKE 'Qcache_queries_in_cache';
115Variable_name	Value
116Qcache_queries_in_cache	1
1171 Expected
118SET @@GLOBAL.query_cache_limit = @global_query_cache_limit;
119SET GLOBAL query_cache_size = @global_query_cache_size;
120SET GLOBAL query_cache_type = @global_query_cache_type;
121DROP TABLE IF EXISTS t;
122