mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / r / partition_cache.result
blobe4e7cc8a4acc83ffc3d0ee638460974381da3944
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;
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;
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;
43 select * from t2;
47 select * from t3;
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;
62 select * from t2;
66 select * from t3;
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;
85 select * from t2;
90 select * from t3;
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(*)
109 insert into t1 (id) values (0);
110 select count(*) from t1;
111 count(*)
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 = 200000;
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(*)
131 UPDATE t2 SET s2 = 'w' WHERE s1 = 3;
132 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
133 count(*)
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(*)
143 INSERT INTO t2 VALUES (5,'w');
144 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
145 count(*)
147 COMMIT;
148 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
149 count(*)
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(*)
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(*)
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(*)
172 START TRANSACTION;
173 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
174 count(*)
176 INSERT INTO t2 VALUES (6,'w');
177 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
178 count(*)
180 connection default
181 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
182 count(*)
184 START TRANSACTION;
185 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
186 count(*)
188 DELETE from t2 WHERE s1=3;
189 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
190 count(*)
192 COMMIT;
193 connection connection1
194 COMMIT;
195 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
196 count(*)
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;