1
set global innodb_file_per_table=off;
2
set global innodb_file_format=`0`;
3
create table t0(a int primary key) engine=innodb row_format=compressed;
5
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
6
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
7
create table t00(a int primary key) engine=innodb
8
key_block_size=4 row_format=compressed;
10
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
11
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
12
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
13
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
14
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
15
create table t1(a int primary key) engine=innodb row_format=dynamic;
17
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
18
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
19
create table t2(a int primary key) engine=innodb row_format=redundant;
20
create table t3(a int primary key) engine=innodb row_format=compact;
21
create table t4(a int primary key) engine=innodb key_block_size=9;
23
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
24
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
25
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
26
create table t5(a int primary key) engine=innodb
27
key_block_size=1 row_format=redundant;
29
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
30
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
31
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
32
set global innodb_file_per_table=on;
33
create table t6(a int primary key) engine=innodb
34
key_block_size=1 row_format=redundant;
36
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
37
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
38
set global innodb_file_format=`1`;
39
create table t7(a int primary key) engine=innodb
40
key_block_size=1 row_format=redundant;
42
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
43
create table t8(a int primary key) engine=innodb
44
key_block_size=1 row_format=fixed;
46
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
47
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
48
create table t9(a int primary key) engine=innodb
49
key_block_size=1 row_format=compact;
51
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
52
create table t10(a int primary key) engine=innodb
53
key_block_size=1 row_format=dynamic;
55
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
56
create table t11(a int primary key) engine=innodb
57
key_block_size=1 row_format=compressed;
58
create table t12(a int primary key) engine=innodb
60
create table t13(a int primary key) engine=innodb
61
row_format=compressed;
62
create table t14(a int primary key) engine=innodb key_block_size=9;
64
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
65
SELECT table_schema, table_name, row_format
66
FROM information_schema.tables WHERE engine='innodb';
67
table_schema table_name row_format
84
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
85
alter table t1 key_block_size=0;
87
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
88
alter table t1 row_format=dynamic;
89
SELECT table_schema, table_name, row_format
90
FROM information_schema.tables WHERE engine='innodb';
91
table_schema table_name row_format
93
alter table t1 row_format=compact;
94
SELECT table_schema, table_name, row_format
95
FROM information_schema.tables WHERE engine='innodb';
96
table_schema table_name row_format
98
alter table t1 row_format=redundant;
99
SELECT table_schema, table_name, row_format
100
FROM information_schema.tables WHERE engine='innodb';
101
table_schema table_name row_format
104
create table t1(a int not null, b text, index(b(10))) engine=innodb
106
create table t2(b text)engine=innodb;
107
insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
108
insert into t1 select 1, b from t2;
111
update t1 set b=repeat('B',100);
112
select a,left(b,40) from t1 natural join t2;
114
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
116
select a,left(b,40) from t1 natural join t2;
118
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
119
SELECT table_schema, table_name, row_format
120
FROM information_schema.tables WHERE engine='innodb';
121
table_schema table_name row_format
125
SET SESSION innodb_strict_mode = on;
127
c TEXT NOT NULL, d TEXT NOT NULL,
128
PRIMARY KEY (c(767),d(767)))
129
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
130
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
132
c TEXT NOT NULL, d TEXT NOT NULL,
133
PRIMARY KEY (c(767),d(767)))
134
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
135
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
137
c TEXT NOT NULL, d TEXT NOT NULL,
138
PRIMARY KEY (c(767),d(767)))
139
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
141
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
142
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
143
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
144
CREATE TABLE t1(c TEXT, PRIMARY KEY (c(439)))
145
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
146
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
148
create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
149
primary key(c1, c2(22), c3(22)))
150
engine = innodb row_format = dynamic;
152
insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
154
update t1 set c3 = repeat('D', 20000) where c1 = 1;
156
select count(*) from t1 where c2 = repeat('A', 20000);
159
select count(*) from t1 where c3 = repeat('D', 20000);
162
select count(*) from t1 where c4 = repeat('C', 20000);
165
update t1 set c3 = repeat('E', 20000) where c1 = 1;
167
set global innodb_file_format=`0`;
168
select @@innodb_file_format;
171
set global innodb_file_format=`1`;
172
select @@innodb_file_format;
175
set global innodb_file_format=`2`;
176
ERROR HY000: Incorrect arguments to SET
177
set global innodb_file_format=`-1`;
178
ERROR HY000: Incorrect arguments to SET
179
set global innodb_file_format=`Antelope`;
180
set global innodb_file_format=`Barracuda`;
181
set global innodb_file_format=`Cheetah`;
182
ERROR HY000: Incorrect arguments to SET
183
set global innodb_file_format=`abc`;
184
ERROR HY000: Incorrect arguments to SET
185
set global innodb_file_format=`1a`;
186
ERROR HY000: Incorrect arguments to SET
187
set global innodb_file_format=``;
188
ERROR HY000: Incorrect arguments to SET
189
set global innodb_file_per_table = on;
190
set global innodb_file_format = `1`;
191
set innodb_strict_mode = off;
192
create table t1 (id int primary key) engine = innodb key_block_size = 0;
194
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
196
set innodb_strict_mode = on;
197
create table t1 (id int primary key) engine = innodb key_block_size = 0;
198
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
201
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
202
Error 1005 Can't create table 'test.t1' (errno: 1478)
203
create table t2 (id int primary key) engine = innodb key_block_size = 9;
204
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
207
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
208
Error 1005 Can't create table 'test.t2' (errno: 1478)
209
create table t3 (id int primary key) engine = innodb key_block_size = 1;
210
create table t4 (id int primary key) engine = innodb key_block_size = 2;
211
create table t5 (id int primary key) engine = innodb key_block_size = 4;
212
create table t6 (id int primary key) engine = innodb key_block_size = 8;
213
create table t7 (id int primary key) engine = innodb key_block_size = 16;
214
create table t8 (id int primary key) engine = innodb row_format = compressed;
215
create table t9 (id int primary key) engine = innodb row_format = dynamic;
216
create table t10(id int primary key) engine = innodb row_format = compact;
217
create table t11(id int primary key) engine = innodb row_format = redundant;
218
SELECT table_schema, table_name, row_format
219
FROM information_schema.tables WHERE engine='innodb';
220
table_schema table_name row_format
230
drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
231
create table t1 (id int primary key) engine = innodb
232
key_block_size = 8 row_format = compressed;
233
create table t2 (id int primary key) engine = innodb
234
key_block_size = 8 row_format = redundant;
235
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
238
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
239
Error 1005 Can't create table 'test.t2' (errno: 1478)
240
create table t3 (id int primary key) engine = innodb
241
key_block_size = 8 row_format = compact;
242
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
245
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
246
Error 1005 Can't create table 'test.t3' (errno: 1478)
247
create table t4 (id int primary key) engine = innodb
248
key_block_size = 8 row_format = dynamic;
249
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
252
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
253
Error 1005 Can't create table 'test.t4' (errno: 1478)
254
create table t5 (id int primary key) engine = innodb
255
key_block_size = 8 row_format = default;
256
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
259
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
260
Error 1005 Can't create table 'test.t5' (errno: 1478)
261
SELECT table_schema, table_name, row_format
262
FROM information_schema.tables WHERE engine='innodb';
263
table_schema table_name row_format
266
create table t1 (id int primary key) engine = innodb
267
key_block_size = 9 row_format = redundant;
268
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
271
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
272
Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
273
Error 1005 Can't create table 'test.t1' (errno: 1478)
274
create table t2 (id int primary key) engine = innodb
275
key_block_size = 9 row_format = compact;
276
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
279
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
280
Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
281
Error 1005 Can't create table 'test.t2' (errno: 1478)
282
create table t2 (id int primary key) engine = innodb
283
key_block_size = 9 row_format = dynamic;
284
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
287
Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
288
Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
289
Error 1005 Can't create table 'test.t2' (errno: 1478)
290
SELECT table_schema, table_name, row_format
291
FROM information_schema.tables WHERE engine='innodb';
292
table_schema table_name row_format
293
set global innodb_file_per_table = off;
294
create table t1 (id int primary key) engine = innodb key_block_size = 1;
295
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
298
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
299
Error 1005 Can't create table 'test.t1' (errno: 1478)
300
create table t2 (id int primary key) engine = innodb key_block_size = 2;
301
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
304
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
305
Error 1005 Can't create table 'test.t2' (errno: 1478)
306
create table t3 (id int primary key) engine = innodb key_block_size = 4;
307
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
310
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
311
Error 1005 Can't create table 'test.t3' (errno: 1478)
312
create table t4 (id int primary key) engine = innodb key_block_size = 8;
313
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
316
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
317
Error 1005 Can't create table 'test.t4' (errno: 1478)
318
create table t5 (id int primary key) engine = innodb key_block_size = 16;
319
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
322
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
323
Error 1005 Can't create table 'test.t5' (errno: 1478)
324
create table t6 (id int primary key) engine = innodb row_format = compressed;
325
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
328
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
329
Error 1005 Can't create table 'test.t6' (errno: 1478)
330
create table t7 (id int primary key) engine = innodb row_format = dynamic;
331
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
334
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
335
Error 1005 Can't create table 'test.t7' (errno: 1478)
336
create table t8 (id int primary key) engine = innodb row_format = compact;
337
create table t9 (id int primary key) engine = innodb row_format = redundant;
338
SELECT table_schema, table_name, row_format
339
FROM information_schema.tables WHERE engine='innodb';
340
table_schema table_name row_format
344
set global innodb_file_per_table = on;
345
set global innodb_file_format = `0`;
346
create table t1 (id int primary key) engine = innodb key_block_size = 1;
347
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
350
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
351
Error 1005 Can't create table 'test.t1' (errno: 1478)
352
create table t2 (id int primary key) engine = innodb key_block_size = 2;
353
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
356
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
357
Error 1005 Can't create table 'test.t2' (errno: 1478)
358
create table t3 (id int primary key) engine = innodb key_block_size = 4;
359
ERROR HY000: Can't create table 'test.t3' (errno: 1478)
362
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
363
Error 1005 Can't create table 'test.t3' (errno: 1478)
364
create table t4 (id int primary key) engine = innodb key_block_size = 8;
365
ERROR HY000: Can't create table 'test.t4' (errno: 1478)
368
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
369
Error 1005 Can't create table 'test.t4' (errno: 1478)
370
create table t5 (id int primary key) engine = innodb key_block_size = 16;
371
ERROR HY000: Can't create table 'test.t5' (errno: 1478)
374
Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
375
Error 1005 Can't create table 'test.t5' (errno: 1478)
376
create table t6 (id int primary key) engine = innodb row_format = compressed;
377
ERROR HY000: Can't create table 'test.t6' (errno: 1478)
380
Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
381
Error 1005 Can't create table 'test.t6' (errno: 1478)
382
create table t7 (id int primary key) engine = innodb row_format = dynamic;
383
ERROR HY000: Can't create table 'test.t7' (errno: 1478)
386
Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
387
Error 1005 Can't create table 'test.t7' (errno: 1478)
388
create table t8 (id int primary key) engine = innodb row_format = compact;
389
create table t9 (id int primary key) engine = innodb row_format = redundant;
390
SELECT table_schema, table_name, row_format
391
FROM information_schema.tables WHERE engine='innodb';
392
table_schema table_name row_format
396
set global innodb_file_per_table=0;
397
set global innodb_file_format=Antelope;
398
set global innodb_file_per_table=on;
399
set global innodb_file_format=`Barracuda`;
400
set global innodb_file_format_check=`Antelope`;
401
create table normal_table (
404
select @@innodb_file_format_check;
405
@@innodb_file_format_check
407
create table zip_table (
409
) engine = innodb key_block_size = 8;
410
select @@innodb_file_format_check;
411
@@innodb_file_format_check
413
set global innodb_file_format_check=`Antelope`;
414
select @@innodb_file_format_check;
415
@@innodb_file_format_check
418
select @@innodb_file_format_check;
419
@@innodb_file_format_check
421
drop table normal_table, zip_table;