~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/mysql-test/innodb-zip.test

  • Committer: Brian Aker
  • Date: 2009-02-05 09:11:16 UTC
  • Revision ID: brian@tangent.org-20090205091116-iy0ersp6bhyzt1ad
Removed dead variables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/have_innodb.inc
 
2
 
 
3
let $per_table=`select @@innodb_file_per_table`;
 
4
let $format=`select @@innodb_file_format`;
 
5
set global innodb_file_per_table=off;
 
6
set global innodb_file_format=`0`;
 
7
 
 
8
create table t0(a int primary key) engine=innodb row_format=compressed;
 
9
create table t00(a int primary key) engine=innodb
 
10
key_block_size=4 row_format=compressed;
 
11
create table t1(a int primary key) engine=innodb row_format=dynamic;
 
12
create table t2(a int primary key) engine=innodb row_format=redundant;
 
13
create table t3(a int primary key) engine=innodb row_format=compact;
 
14
create table t4(a int primary key) engine=innodb key_block_size=9;
 
15
create table t5(a int primary key) engine=innodb
 
16
key_block_size=1 row_format=redundant;
 
17
 
 
18
set global innodb_file_per_table=on;
 
19
create table t6(a int primary key) engine=innodb
 
20
key_block_size=1 row_format=redundant;
 
21
set global innodb_file_format=`1`;
 
22
create table t7(a int primary key) engine=innodb
 
23
key_block_size=1 row_format=redundant;
 
24
create table t8(a int primary key) engine=innodb
 
25
key_block_size=1 row_format=fixed;
 
26
create table t9(a int primary key) engine=innodb
 
27
key_block_size=1 row_format=compact;
 
28
create table t10(a int primary key) engine=innodb
 
29
key_block_size=1 row_format=dynamic;
 
30
create table t11(a int primary key) engine=innodb
 
31
key_block_size=1 row_format=compressed;
 
32
create table t12(a int primary key) engine=innodb
 
33
key_block_size=1;
 
34
create table t13(a int primary key) engine=innodb
 
35
row_format=compressed;
 
36
create table t14(a int primary key) engine=innodb key_block_size=9;
 
37
 
 
38
SELECT table_schema, table_name, row_format
 
39
FROM information_schema.tables WHERE engine='innodb';
 
40
 
 
41
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
 
42
alter table t1 key_block_size=0;
 
43
alter table t1 row_format=dynamic;
 
44
SELECT table_schema, table_name, row_format
 
45
FROM information_schema.tables WHERE engine='innodb';
 
46
alter table t1 row_format=compact;
 
47
SELECT table_schema, table_name, row_format
 
48
FROM information_schema.tables WHERE engine='innodb';
 
49
alter table t1 row_format=redundant;
 
50
SELECT table_schema, table_name, row_format
 
51
FROM information_schema.tables WHERE engine='innodb';
 
52
drop table t1;
 
53
 
 
54
create table t1(a int not null, b text, index(b(10))) engine=innodb
 
55
key_block_size=1;
 
56
 
 
57
create table t2(b text)engine=innodb;
 
58
insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
 
59
 
 
60
insert into t1 select 1, b from t2;
 
61
commit;
 
62
 
 
63
connect (a,localhost,root,,);
 
64
connect (b,localhost,root,,);
 
65
 
 
66
connection a;
 
67
begin;
 
68
update t1 set b=repeat('B',100);
 
69
 
 
70
connection b;
 
71
select a,left(b,40) from t1 natural join t2;
 
72
 
 
73
connection a;
 
74
rollback;
 
75
 
 
76
connection b;
 
77
select a,left(b,40) from t1 natural join t2;
 
78
 
 
79
connection default;
 
80
disconnect a;
 
81
disconnect b;
 
82
 
 
83
SELECT table_schema, table_name, row_format
 
84
FROM information_schema.tables WHERE engine='innodb';
 
85
drop table t1,t2;
 
86
 
 
87
SET SESSION innodb_strict_mode = on;
 
88
--error ER_TOO_BIG_ROWSIZE
 
89
CREATE TABLE t1(
 
90
        c TEXT NOT NULL, d TEXT NOT NULL,
 
91
        PRIMARY KEY (c(767),d(767)))
 
92
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
 
93
--error ER_TOO_BIG_ROWSIZE
 
94
CREATE TABLE t1(
 
95
        c TEXT NOT NULL, d TEXT NOT NULL,
 
96
        PRIMARY KEY (c(767),d(767)))
 
97
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
 
98
CREATE TABLE t1(
 
99
        c TEXT NOT NULL, d TEXT NOT NULL,
 
100
        PRIMARY KEY (c(767),d(767)))
 
101
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
 
102
drop table t1;
 
103
--error ER_TOO_BIG_ROWSIZE
 
104
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
 
105
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
 
106
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(439)))
 
107
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
 
108
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
 
109
DROP TABLE t1;
 
110
 
 
111
#
 
112
# Test blob column inheritance (mantis issue#36)
 
113
#
 
114
 
 
115
create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
 
116
                primary key(c1, c2(22), c3(22)))
 
117
                engine = innodb row_format = dynamic;
 
118
begin;
 
119
insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
 
120
                        repeat('C', 20000));
 
121
 
 
122
update t1 set c3 = repeat('D', 20000) where c1 = 1;
 
123
commit;
 
124
 
 
125
# one blob column which is unchanged in update and part of PK
 
126
# one blob column which is changed and part of of PK
 
127
# one blob column which is not part of PK and is unchanged
 
128
select count(*) from t1 where c2 = repeat('A', 20000);
 
129
select count(*) from t1 where c3 = repeat('D', 20000);
 
130
select count(*) from t1 where c4 = repeat('C', 20000);
 
131
 
 
132
update t1 set c3 = repeat('E', 20000) where c1 = 1;
 
133
drop table t1;
 
134
 
 
135
#
 
136
#
 
137
# Test innodb_file_format
 
138
#
 
139
set global innodb_file_format=`0`;
 
140
select @@innodb_file_format;
 
141
set global innodb_file_format=`1`;
 
142
select @@innodb_file_format;
 
143
-- error ER_WRONG_ARGUMENTS
 
144
set global innodb_file_format=`2`;
 
145
-- error ER_WRONG_ARGUMENTS
 
146
set global innodb_file_format=`-1`;
 
147
set global innodb_file_format=`Antelope`;
 
148
set global innodb_file_format=`Barracuda`;
 
149
-- error ER_WRONG_ARGUMENTS
 
150
set global innodb_file_format=`Cheetah`;
 
151
-- error ER_WRONG_ARGUMENTS
 
152
set global innodb_file_format=`abc`;
 
153
-- error ER_WRONG_ARGUMENTS
 
154
set global innodb_file_format=`1a`;
 
155
-- error ER_WRONG_ARGUMENTS
 
156
set global innodb_file_format=``;
 
157
 
 
158
#test strict mode.
 
159
--enable_errors
 
160
set global innodb_file_per_table = on;
 
161
set global innodb_file_format = `1`;
 
162
 
 
163
set innodb_strict_mode = off;
 
164
create table t1 (id int primary key) engine = innodb key_block_size = 0;
 
165
drop table t1;
 
166
 
 
167
#set strict_mode
 
168
set innodb_strict_mode = on;
 
169
 
 
170
#Test different values of KEY_BLOCK_SIZE
 
171
 
 
172
--error ER_CANT_CREATE_TABLE
 
173
create table t1 (id int primary key) engine = innodb key_block_size = 0;
 
174
show errors;
 
175
 
 
176
--error ER_CANT_CREATE_TABLE
 
177
create table t2 (id int primary key) engine = innodb key_block_size = 9;
 
178
show errors;
 
179
 
 
180
 
 
181
create table t3 (id int primary key) engine = innodb key_block_size = 1;
 
182
create table t4 (id int primary key) engine = innodb key_block_size = 2;
 
183
create table t5 (id int primary key) engine = innodb key_block_size = 4;
 
184
create table t6 (id int primary key) engine = innodb key_block_size = 8;
 
185
create table t7 (id int primary key) engine = innodb key_block_size = 16;
 
186
 
 
187
#check various ROW_FORMAT values.
 
188
create table t8 (id int primary key) engine = innodb row_format = compressed;
 
189
create table t9 (id int primary key) engine = innodb row_format = dynamic;
 
190
create table t10(id int primary key) engine = innodb row_format = compact;
 
191
create table t11(id int primary key) engine = innodb row_format = redundant;
 
192
 
 
193
SELECT table_schema, table_name, row_format
 
194
FROM information_schema.tables WHERE engine='innodb';
 
195
drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
 
196
 
 
197
#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
 
198
create table t1 (id int primary key) engine = innodb
 
199
key_block_size = 8 row_format = compressed;
 
200
 
 
201
--error ER_CANT_CREATE_TABLE
 
202
create table t2 (id int primary key) engine = innodb
 
203
key_block_size = 8 row_format = redundant;
 
204
show errors;
 
205
 
 
206
--error ER_CANT_CREATE_TABLE
 
207
create table t3 (id int primary key) engine = innodb
 
208
key_block_size = 8 row_format = compact;
 
209
show errors;
 
210
 
 
211
--error ER_CANT_CREATE_TABLE
 
212
create table t4 (id int primary key) engine = innodb
 
213
key_block_size = 8 row_format = dynamic;
 
214
show errors;
 
215
 
 
216
--error ER_CANT_CREATE_TABLE
 
217
create table t5 (id int primary key) engine = innodb
 
218
key_block_size = 8 row_format = default;
 
219
show errors;
 
220
 
 
221
SELECT table_schema, table_name, row_format
 
222
FROM information_schema.tables WHERE engine='innodb';
 
223
drop table t1;
 
224
 
 
225
#test multiple errors
 
226
--error ER_CANT_CREATE_TABLE
 
227
create table t1 (id int primary key) engine = innodb
 
228
key_block_size = 9 row_format = redundant;
 
229
show errors;
 
230
 
 
231
--error ER_CANT_CREATE_TABLE
 
232
create table t2 (id int primary key) engine = innodb
 
233
key_block_size = 9 row_format = compact;
 
234
show errors;
 
235
 
 
236
--error ER_CANT_CREATE_TABLE
 
237
create table t2 (id int primary key) engine = innodb
 
238
key_block_size = 9 row_format = dynamic;
 
239
show errors;
 
240
 
 
241
SELECT table_schema, table_name, row_format
 
242
FROM information_schema.tables WHERE engine='innodb';
 
243
 
 
244
#test valid values with innodb_file_per_table unset
 
245
set global innodb_file_per_table = off;
 
246
 
 
247
--error ER_CANT_CREATE_TABLE
 
248
create table t1 (id int primary key) engine = innodb key_block_size = 1;
 
249
show errors;
 
250
--error ER_CANT_CREATE_TABLE
 
251
create table t2 (id int primary key) engine = innodb key_block_size = 2;
 
252
show errors;
 
253
--error ER_CANT_CREATE_TABLE
 
254
create table t3 (id int primary key) engine = innodb key_block_size = 4;
 
255
show errors;
 
256
--error ER_CANT_CREATE_TABLE
 
257
create table t4 (id int primary key) engine = innodb key_block_size = 8;
 
258
show errors;
 
259
--error ER_CANT_CREATE_TABLE
 
260
create table t5 (id int primary key) engine = innodb key_block_size = 16;
 
261
show errors;
 
262
--error ER_CANT_CREATE_TABLE
 
263
create table t6 (id int primary key) engine = innodb row_format = compressed;
 
264
show errors;
 
265
--error ER_CANT_CREATE_TABLE
 
266
create table t7 (id int primary key) engine = innodb row_format = dynamic;
 
267
show errors;
 
268
create table t8 (id int primary key) engine = innodb row_format = compact;
 
269
create table t9 (id int primary key) engine = innodb row_format = redundant;
 
270
 
 
271
SELECT table_schema, table_name, row_format
 
272
FROM information_schema.tables WHERE engine='innodb';
 
273
drop table t8, t9;
 
274
 
 
275
#test valid values with innodb_file_format unset
 
276
set global innodb_file_per_table = on;
 
277
set global innodb_file_format = `0`; 
 
278
 
 
279
--error ER_CANT_CREATE_TABLE
 
280
create table t1 (id int primary key) engine = innodb key_block_size = 1;
 
281
show errors;
 
282
--error ER_CANT_CREATE_TABLE
 
283
create table t2 (id int primary key) engine = innodb key_block_size = 2;
 
284
show errors;
 
285
--error ER_CANT_CREATE_TABLE
 
286
create table t3 (id int primary key) engine = innodb key_block_size = 4;
 
287
show errors;
 
288
--error ER_CANT_CREATE_TABLE
 
289
create table t4 (id int primary key) engine = innodb key_block_size = 8;
 
290
show errors;
 
291
--error ER_CANT_CREATE_TABLE
 
292
create table t5 (id int primary key) engine = innodb key_block_size = 16;
 
293
show errors;
 
294
--error ER_CANT_CREATE_TABLE
 
295
create table t6 (id int primary key) engine = innodb row_format = compressed;
 
296
show errors;
 
297
--error ER_CANT_CREATE_TABLE
 
298
create table t7 (id int primary key) engine = innodb row_format = dynamic;
 
299
show errors;
 
300
create table t8 (id int primary key) engine = innodb row_format = compact;
 
301
create table t9 (id int primary key) engine = innodb row_format = redundant;
 
302
 
 
303
SELECT table_schema, table_name, row_format
 
304
FROM information_schema.tables WHERE engine='innodb';
 
305
drop table t8, t9;
 
306
 
 
307
eval set global innodb_file_per_table=$per_table;
 
308
eval set global innodb_file_format=$format;
 
309
#
 
310
# Testing of tablespace tagging
 
311
#
 
312
-- disable_info
 
313
set global innodb_file_per_table=on;
 
314
set global innodb_file_format=`Barracuda`;
 
315
set global innodb_file_format_check=`Antelope`;
 
316
create table normal_table (
 
317
  c1 int
 
318
) engine = innodb;
 
319
select @@innodb_file_format_check;
 
320
create table zip_table (
 
321
  c1 int
 
322
) engine = innodb key_block_size = 8;
 
323
select @@innodb_file_format_check;
 
324
set global innodb_file_format_check=`Antelope`;
 
325
select @@innodb_file_format_check;
 
326
-- disable_result_log
 
327
show table status;
 
328
-- enable_result_log
 
329
select @@innodb_file_format_check;
 
330
drop table normal_table, zip_table;
 
331
-- disable_result_log