~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/key_cache.result

  • Committer: Brian Aker
  • Date: 2009-01-07 01:37:52 UTC
  • Revision ID: brian@tangent.org-20090107013752-xbc5vhh3rf2wlj5l
Fixed key_cache test

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
SET @save_key_buffer=@@key_buffer_size;
3
3
SELECT @@key_buffer_size, @@small.key_buffer_size;
4
4
@@key_buffer_size       @@small.key_buffer_size
5
 
2097152 131072
 
5
1048576 0
6
6
SET @@global.key_buffer_size=16*1024*1024;
7
7
SET @@global.default.key_buffer_size=16*1024*1024;
8
8
SET @@global.default.key_buffer_size=16*1024*1024;
39
39
0
40
40
SET @@global.key_buffer_size=@save_key_buffer;
41
41
SELECT @@default.key_buffer_size;
42
 
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default.key_buffer_size' at line 1
 
42
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'default.key_buffer_size' at line 1
43
43
SELECT @@skr.storage_engine="test";
44
44
ERROR HY000: Variable 'storage_engine' is not a variable component (can't be used as XXXX.variable_name)
45
45
select @@keycache1.key_cache_block_size;
78
78
2048
79
79
select @@key_buffer_size;
80
80
@@key_buffer_size
81
 
2097152
 
81
1048576
82
82
select @@key_cache_block_size;
83
83
@@key_cache_block_size
84
84
1024
85
85
set global keycache1.key_buffer_size=1024*1024;
86
 
create table t1 (p int primary key, a char(10)) delay_key_write=1;
87
 
create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a));
 
86
create table t1 (p int primary key, a char(10)) delay_key_write=1 ENGINE=myisam;
 
87
create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a)) ENGINE=myisam;
88
88
show status like 'key_blocks_used';
89
89
Variable_name   Value
90
90
Key_blocks_used 0
91
91
show status like 'key_blocks_unused';
92
92
Variable_name   Value
93
 
Key_blocks_unused       KEY_BLOCKS_UNUSED
 
93
Key_blocks_unused       837
94
94
insert into t1 values (1, 'qqqq'), (11, 'yyyy');
95
95
insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
96
96
(3, 1, 'yyyy'), (4, 3, 'zzzz');
111
111
Key_blocks_used 4
112
112
show status like 'key_blocks_unused';
113
113
Variable_name   Value
114
 
Key_blocks_unused       KEY_BLOCKS_UNUSED
 
114
Key_blocks_unused       833
115
115
cache index t1 key (`primary`) in keycache1;
116
116
Table   Op      Msg_type        Msg_text
117
117
test.t1 assign_to_keycache      status  OK
179
179
3
180
180
explain select a from t2;
181
181
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
182
 
1       SIMPLE  t2      index   NULL    k2      11      NULL    5       Using index
 
182
1       SIMPLE  t2      index   NULL    k2      43      NULL    5       Using index
183
183
select a from t2;
184
184
a
185
185
pppp
239
239
3
240
240
explain select a from t2;
241
241
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
242
 
1       SIMPLE  t2      index   NULL    k2      11      NULL    5       Using index
 
242
1       SIMPLE  t2      index   NULL    k2      43      NULL    5       Using index
243
243
select a from t2;
244
244
a
245
245
pppp
273
273
Key_blocks_used 4
274
274
show status like 'key_blocks_unused';
275
275
Variable_name   Value
276
 
Key_blocks_unused       KEY_BLOCKS_UNUSED
 
276
Key_blocks_unused       837
277
277
set global keycache2.key_buffer_size=0;
278
278
set global keycache3.key_buffer_size=100;
279
279
Warnings:
280
280
Warning 1292    Truncated incorrect key_buffer_size value: '100'
281
281
set global keycache3.key_buffer_size=0;
282
 
create table t1 (mytext text, FULLTEXT (mytext));
283
 
insert t1 values ('aaabbb');
284
 
check table t1;
285
 
Table   Op      Msg_type        Msg_text
286
 
test.t1 check   status  OK
287
 
set @my_key_cache_block_size= @@global.key_cache_block_size;
288
 
set GLOBAL key_cache_block_size=2048;
289
 
check table t1;
290
 
Table   Op      Msg_type        Msg_text
291
 
test.t1 check   status  OK
292
 
drop table t1;
293
282
set global key_cache_block_size= @my_key_cache_block_size;
294
 
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY);
 
283
ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
 
284
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=MYISAM;
295
285
SET @my_key_cache_block_size= @@global.key_cache_block_size;
296
286
SET GLOBAL key_cache_block_size=1536;
297
287
INSERT INTO t1 VALUES (1);
302
292
Table   Op      Msg_type        Msg_text
303
293
test.t1 check   status  OK
304
294
DROP TABLE t1;
305
 
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
306
 
CREATE TABLE t2(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
 
295
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int) ENGINE=MYISAM;
 
296
CREATE TABLE t2(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int) ENGINE=MYISAM;
307
297
SET GLOBAL key_cache_block_size=1536;
308
298
INSERT INTO t1 VALUES (1,0);
309
299
INSERT INTO t2(b) SELECT b FROM t1;
340
330
Warning 1438    Cannot drop default keycache
341
331
select @@global.key_buffer_size;
342
332
@@global.key_buffer_size
343
 
2097152
 
333
1048576
344
334
SET @bug28478_key_cache_block_size= @@global.key_cache_block_size;
345
335
SET GLOBAL key_cache_block_size= 1536;
346
336
CREATE TABLE t1 (
347
337
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
348
 
c1 CHAR(150),
349
 
c2 CHAR(150),
350
 
c3 CHAR(150),
 
338
c1 CHAR(50),
 
339
c2 CHAR(50),
 
340
c3 CHAR(50),
351
341
KEY(c1, c2, c3)
352
342
) ENGINE= MyISAM;
353
343
INSERT INTO t1 (c1, c2, c3) VALUES