~james-page/ubuntu/precise/mysql-5.5/misc-fixes

« back to all changes in this revision

Viewing changes to mysql-test/r/partition_cache.result

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-06-11 07:34:33 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120611073433-l9za2ni4ipp848y3
Tags: 5.5.24-0ubuntu0.12.04.1
* SECURITY UPDATE: Update to 5.5.24 to fix security issues (LP: #1011371)
  - http://dev.mysql.com/doc/refman/5.5/en/news-5-5-24.html

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
SET SESSION STORAGE_ENGINE = InnoDB;
 
2
drop table if exists t1,t2,t3;
 
3
set @save_query_cache_size = @@global.query_cache_size;
 
4
set GLOBAL query_cache_size = 1355776;
 
5
flush status;
 
6
set autocommit=0;
 
7
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
 
8
insert into t1 values (1),(2),(3);
 
9
select * from t1;
 
10
a
 
11
1
 
12
2
 
13
3
 
14
show status like "Qcache_queries_in_cache";
 
15
Variable_name   Value
 
16
Qcache_queries_in_cache 0
 
17
drop table t1;
 
18
commit;
 
19
set autocommit=1;
 
20
begin;
 
21
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
 
22
insert into t1 values (1),(2),(3);
 
23
select * from t1;
 
24
a
 
25
1
 
26
2
 
27
3
 
28
show status like "Qcache_queries_in_cache";
 
29
Variable_name   Value
 
30
Qcache_queries_in_cache 0
 
31
drop table t1;
 
32
commit;
 
33
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
 
34
create table t2 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
 
35
create table t3 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
 
36
insert into t1 values (1),(2);
 
37
insert into t2 values (1),(2);
 
38
insert into t3 values (1),(2);
 
39
select * from t1;
 
40
a
 
41
1
 
42
2
 
43
select * from t2;
 
44
a
 
45
1
 
46
2
 
47
select * from t3;
 
48
a
 
49
1
 
50
2
 
51
show status like "Qcache_queries_in_cache";
 
52
Variable_name   Value
 
53
Qcache_queries_in_cache 0
 
54
show status like "Qcache_hits";
 
55
Variable_name   Value
 
56
Qcache_hits     0
 
57
begin;
 
58
select * from t1;
 
59
a
 
60
1
 
61
2
 
62
select * from t2;
 
63
a
 
64
1
 
65
2
 
66
select * from t3;
 
67
a
 
68
1
 
69
2
 
70
show status like "Qcache_queries_in_cache";
 
71
Variable_name   Value
 
72
Qcache_queries_in_cache 0
 
73
show status like "Qcache_hits";
 
74
Variable_name   Value
 
75
Qcache_hits     0
 
76
insert into t1 values (3);
 
77
insert into t2 values (3);
 
78
insert into t1 values (4);
 
79
select * from t1;
 
80
a
 
81
1
 
82
2
 
83
3
 
84
4
 
85
select * from t2;
 
86
a
 
87
1
 
88
2
 
89
3
 
90
select * from t3;
 
91
a
 
92
1
 
93
2
 
94
show status like "Qcache_queries_in_cache";
 
95
Variable_name   Value
 
96
Qcache_queries_in_cache 0
 
97
show status like "Qcache_hits";
 
98
Variable_name   Value
 
99
Qcache_hits     0
 
100
commit;
 
101
show status like "Qcache_queries_in_cache";
 
102
Variable_name   Value
 
103
Qcache_queries_in_cache 0
 
104
drop table t3,t2,t1;
 
105
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) PARTITION BY HASH (id) PARTITIONS 3;
 
106
select count(*) from t1;
 
107
count(*)
 
108
0
 
109
insert into t1 (id) values (0);
 
110
select count(*) from t1;
 
111
count(*)
 
112
1
 
113
drop table t1;
 
114
SET SESSION STORAGE_ENGINE = InnoDB;
 
115
SET @@autocommit=1;
 
116
connection default
 
117
SHOW VARIABLES LIKE 'have_query_cache';
 
118
Variable_name   Value
 
119
have_query_cache        YES
 
120
SET GLOBAL query_cache_size = 204800;
 
121
flush status;
 
122
SET @@autocommit=1;
 
123
SET SESSION STORAGE_ENGINE = InnoDB;
 
124
CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1)) PARTITION BY KEY (s1) PARTITIONS 3;
 
125
INSERT INTO t2 VALUES (1,repeat('a',10)),(2,repeat('a',10)),(3,repeat('a',10)),(4,repeat('a',10));
 
126
COMMIT;
 
127
START TRANSACTION;
 
128
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
129
count(*)
 
130
0
 
131
UPDATE t2 SET s2 = 'w' WHERE s1 = 3;
 
132
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
133
count(*)
 
134
1
 
135
show status like "Qcache_queries_in_cache";
 
136
Variable_name   Value
 
137
Qcache_queries_in_cache 0
 
138
connection connection1
 
139
START TRANSACTION;
 
140
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
141
count(*)
 
142
0
 
143
INSERT INTO t2 VALUES (5,'w');
 
144
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
145
count(*)
 
146
1
 
147
COMMIT;
 
148
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
149
count(*)
 
150
1
 
151
show status like "Qcache_queries_in_cache";
 
152
Variable_name   Value
 
153
Qcache_queries_in_cache 0
 
154
connection default
 
155
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
156
count(*)
 
157
1
 
158
COMMIT;
 
159
show status like "Qcache_queries_in_cache";
 
160
Variable_name   Value
 
161
Qcache_queries_in_cache 0
 
162
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
163
count(*)
 
164
2
 
165
show status like "Qcache_queries_in_cache";
 
166
Variable_name   Value
 
167
Qcache_queries_in_cache 0
 
168
connection connection1
 
169
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
170
count(*)
 
171
2
 
172
START TRANSACTION;
 
173
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
174
count(*)
 
175
2
 
176
INSERT INTO t2 VALUES (6,'w');
 
177
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
178
count(*)
 
179
3
 
180
connection default
 
181
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
182
count(*)
 
183
2
 
184
START TRANSACTION;
 
185
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
186
count(*)
 
187
2
 
188
DELETE from t2 WHERE s1=3;
 
189
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
190
count(*)
 
191
1
 
192
COMMIT;
 
193
connection connection1
 
194
COMMIT;
 
195
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
 
196
count(*)
 
197
2
 
198
show status like "Qcache_queries_in_cache";
 
199
Variable_name   Value
 
200
Qcache_queries_in_cache 0
 
201
show status like "Qcache_hits";
 
202
Variable_name   Value
 
203
Qcache_hits     0
 
204
set @@global.query_cache_size = @save_query_cache_size;
 
205
drop table t2;