~percona-dev/percona-server/release-5.1.47-12

26.2.1 by Oleg Tsarev
fix issue 10927 - query_cache_with_comments
1
-- source include/have_query_cache.inc
2
3
set GLOBAL query_cache_size=1355776;
4
5
# Reset query cache variables.
6
flush query cache; # This crashed in some versions
7
flush query cache; # This crashed in some versions
8
reset query cache;
9
flush status;
10
--disable_warnings
11
drop table if exists t1;
12
--enable_warnings
13
14
#
15
# First simple test
16
#
17
18
create table t1 (a int not null);
19
insert into t1 values (1),(2),(3);
20
26.2.2 by Oleg Tsarev
add flag query_cache_strip_comments
21
set global query_cache_strip_comments=ON;
22
26.2.1 by Oleg Tsarev
fix issue 10927 - query_cache_with_comments
23
show status like "Qcache_queries_in_cache";
24
show status like "Qcache_inserts";
25
show status like "Qcache_hits";
26
26.2.3 by Oleg Tsarev
fix bugs, improve perfomance
27
/* with comment */ select * from t1;
28
29
show status like "Qcache_queries_in_cache";
30
show status like "Qcache_inserts";
31
show status like "Qcache_hits";
32
33
/* with comment */ select * from t1;
34
/* with comment */ select * from t1;
35
/* with comment */ select * from t1;
36
/* with comment */ select * from t1;
37
/* with comment */ select * from t1;
38
39
show status like "Qcache_queries_in_cache";
40
show status like "Qcache_inserts";
41
show status like "Qcache_hits";
42
43
select * from t1;
26.2.1 by Oleg Tsarev
fix issue 10927 - query_cache_with_comments
44
45
show status like "Qcache_queries_in_cache";
46
show status like "Qcache_inserts";
47
show status like "Qcache_hits";
48
49
select * /*internal comment*/from t1;
50
51
show status like "Qcache_queries_in_cache";
52
show status like "Qcache_inserts";
53
show status like "Qcache_hits";
54
55
select * /*internal comment*/ from t1;
56
57
show status like "Qcache_queries_in_cache";
58
show status like "Qcache_inserts";
59
show status like "Qcache_hits";
60
61
select * from t1 /* at the end */;
62
63
show status like "Qcache_queries_in_cache";
64
show status like "Qcache_inserts";
65
show status like "Qcache_hits";
66
67
select * from t1 /* with "quote" */;
68
69
show status like "Qcache_queries_in_cache";
70
show status like "Qcache_inserts";
71
show status like "Qcache_hits";
72
73
select * from t1 /* with 'quote' */;
74
75
show status like "Qcache_queries_in_cache";
76
show status like "Qcache_inserts";
77
show status like "Qcache_hits";
78
79
select * from t1 # 123
80
;
81
82
show status like "Qcache_queries_in_cache";
83
show status like "Qcache_inserts";
84
show status like "Qcache_hits";
85
86
select * from t1 # 123 with "quote"
87
;
88
89
show status like "Qcache_queries_in_cache";
90
show status like "Qcache_inserts";
91
show status like "Qcache_hits";
92
93
select * from t1 # 123 with 'quote'
94
;
95
96
show status like "Qcache_queries_in_cache";
97
show status like "Qcache_inserts";
98
show status like "Qcache_hits";
99
100
select * from t1
101
# 123
102
;
103
104
show status like "Qcache_queries_in_cache";
105
show status like "Qcache_inserts";
106
show status like "Qcache_hits";
107
108
#456
109
select * from t1
110
# 123
111
;
112
113
show status like "Qcache_queries_in_cache";
114
show status like "Qcache_inserts";
115
show status like "Qcache_hits";
116
117
select * from t1 -- 123
118
;
119
120
show status like "Qcache_queries_in_cache";
121
show status like "Qcache_inserts";
122
show status like "Qcache_hits";
123
124
select * from t1
125
-- 123
126
;
127
128
show status like "Qcache_queries_in_cache";
129
show status like "Qcache_inserts";
130
show status like "Qcache_hits";
131
132
select "test",a from t1;
133
select "test",a from t1;
134
select "test",a from t1;
135
136
show status like "Qcache_queries_in_cache";
137
show status like "Qcache_inserts";
138
show status like "Qcache_hits";
139
140
select "test /* internal 'comment' */",a from t1;
141
select "test #internal comment",a from t1;
142
143
show status like "Qcache_queries_in_cache";
144
show status like "Qcache_inserts";
145
show status like "Qcache_hits";
146
147
DROP TABLE t1;
148
SET GLOBAL query_cache_size= default;
26.2.2 by Oleg Tsarev
add flag query_cache_strip_comments
149
set global query_cache_strip_comments=OFF;