~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/key_cache.test

  • Committer: Brian Aker
  • Date: 2009-05-15 17:06:35 UTC
  • mto: This revision was merged to the branch mainline in revision 1023.
  • Revision ID: brian@gaz-20090515170635-croy1u63a3gqdn9n
Dead convert functions for character sets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
set global keycache1.key_buffer_size=1024*1024;
65
65
 
66
 
create table t1 (p int primary key, a char(10)) delay_key_write=1;
67
 
create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a));
 
66
create table t1 (p int primary key, a char(10)) delay_key_write=1 ENGINE=myisam;
 
67
create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a)) ENGINE=myisam;
68
68
 
69
69
show status like 'key_blocks_used';
70
70
 
71
71
# Following results differs on 64 and 32 bit systems because of different
72
72
# pointer sizes, which takes up different amount of space in key cache
73
73
 
74
 
--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED
 
74
--replace_result 837 KEY_BLOCKS_UNUSED 906 KEY_BLOCKS_UNUSED 896 KEY_BLOCKS_UNUSED
75
75
show status like 'key_blocks_unused';
76
76
 
77
77
insert into t1 values (1, 'qqqq'), (11, 'yyyy');
84
84
update t2 set i=2 where i=1;
85
85
 
86
86
show status like 'key_blocks_used';
87
 
--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED 1820 KEY_BLOCKS_UNUSED
 
87
--replace_result 833 KEY_BLOCKS_UNUSED 902 KEY_BLOCKS_UNUSED 892 KEY_BLOCKS_UNUSED
88
88
show status like 'key_blocks_unused';
89
89
 
90
90
cache index t1 key (`primary`) in keycache1;
146
146
drop table t1,t2,t3;
147
147
 
148
148
show status like 'key_blocks_used';
149
 
--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED
 
149
--replace_result 837 KEY_BLOCKS_UNUSED 906 KEY_BLOCKS_UNUSED 896 KEY_BLOCKS_UNUSED
150
150
show status like 'key_blocks_unused';
151
151
 
152
152
 
158
158
set global keycache3.key_buffer_size=100;
159
159
set global keycache3.key_buffer_size=0;
160
160
 
161
 
# Test case for bug 6447
162
 
 
163
 
create table t1 (mytext text, FULLTEXT (mytext));
164
 
insert t1 values ('aaabbb');
165
 
 
166
 
check table t1;
167
 
set @my_key_cache_block_size= @@global.key_cache_block_size;
168
 
set GLOBAL key_cache_block_size=2048;
169
 
check table t1;
170
 
drop table t1;
171
161
# Restore the changed variable value
 
162
-- error 1232
172
163
set global key_cache_block_size= @my_key_cache_block_size;
173
164
 
174
165
#
175
166
# Bug #19079: corrupted index when key_cache_block_size is not multiple of
176
167
#             myisam_block_size
177
168
 
178
 
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY);
 
169
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=MYISAM;
179
170
SET @my_key_cache_block_size= @@global.key_cache_block_size;
180
171
SET GLOBAL key_cache_block_size=1536;
181
172
INSERT INTO t1 VALUES (1);
183
174
CHECK TABLE t1;
184
175
DROP TABLE t1;
185
176
 
186
 
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
187
 
CREATE TABLE t2(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int);
 
177
CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int) ENGINE=MYISAM;
 
178
CREATE TABLE t2(a int NOT NULL AUTO_INCREMENT PRIMARY KEY, b int) ENGINE=MYISAM;
188
179
SET GLOBAL key_cache_block_size=1536;
189
180
INSERT INTO t1 VALUES (1,0);
190
181
INSERT INTO t2(b) SELECT b FROM t1;
226
217
SET GLOBAL key_cache_block_size= 1536;
227
218
CREATE TABLE t1 (
228
219
  id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
229
 
  c1 CHAR(150),
230
 
  c2 CHAR(150),
231
 
  c3 CHAR(150),
 
220
  c1 CHAR(50),
 
221
  c2 CHAR(50),
 
222
  c3 CHAR(50),
232
223
  KEY(c1, c2, c3)
233
224
  ) ENGINE= MyISAM;
234
225
INSERT INTO t1 (c1, c2, c3) VALUES