1
-- source include/have_innodb.inc
3
let $per_table=`select @@innodb_file_per_table`;
4
let $format=`select @@innodb_file_format`;
5
let $mode=`select @@innodb_strict_mode`;
6
set global innodb_file_per_table=off;
7
set global innodb_file_format=`0`;
9
create table t0(a int primary key) engine=innodb row_format=compressed;
10
create table t00(a int primary key) engine=innodb
11
key_block_size=4 row_format=compressed;
12
create table t1(a int primary key) engine=innodb row_format=dynamic;
13
create table t2(a int primary key) engine=innodb row_format=redundant;
14
create table t3(a int primary key) engine=innodb row_format=compact;
15
create table t4(a int primary key) engine=innodb key_block_size=9;
16
create table t5(a int primary key) engine=innodb
17
key_block_size=1 row_format=redundant;
19
set global innodb_file_per_table=on;
20
create table t6(a int primary key) engine=innodb
21
key_block_size=1 row_format=redundant;
22
set global innodb_file_format=`1`;
23
create table t7(a int primary key) engine=innodb
24
key_block_size=1 row_format=redundant;
25
create table t8(a int primary key) engine=innodb
26
key_block_size=1 row_format=fixed;
27
create table t9(a int primary key) engine=innodb
28
key_block_size=1 row_format=compact;
29
create table t10(a int primary key) engine=innodb
30
key_block_size=1 row_format=dynamic;
31
create table t11(a int primary key) engine=innodb
32
key_block_size=1 row_format=compressed;
33
create table t12(a int primary key) engine=innodb
35
create table t13(a int primary key) engine=innodb
36
row_format=compressed;
37
create table t14(a int primary key) engine=innodb key_block_size=9;
39
SELECT table_schema, table_name, row_format
40
FROM information_schema.tables WHERE engine='innodb';
42
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
43
alter table t1 key_block_size=0;
44
alter table t1 row_format=dynamic;
45
SELECT table_schema, table_name, row_format
46
FROM information_schema.tables WHERE engine='innodb';
47
alter table t1 row_format=compact;
48
SELECT table_schema, table_name, row_format
49
FROM information_schema.tables WHERE engine='innodb';
50
alter table t1 row_format=redundant;
51
SELECT table_schema, table_name, row_format
52
FROM information_schema.tables WHERE engine='innodb';
55
create table t1(a int not null, b text, index(b(10))) engine=innodb
58
create table t2(b text)engine=innodb;
59
insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
61
insert into t1 select 1, b from t2;
64
connect (a,localhost,root,,);
65
connect (b,localhost,root,,);
69
update t1 set b=repeat('B',100);
72
select a,left(b,40) from t1 natural join t2;
78
select a,left(b,40) from t1 natural join t2;
84
SELECT table_schema, table_name, row_format
85
FROM information_schema.tables WHERE engine='innodb';
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;
94
# random data generated with
95
# perl -e 'my $i,$j,$k;for($j=1;$j<19;$j++){for($i=$k=0;$k<87;$k++,$i+=$j,$i%=87){printf "%c",$i+40}}'
96
# truncated to 2*767 bytes and split to two 767-byte columns
97
--error ER_TOO_BIG_ROWSIZE
98
INSERT INTO t1 VALUES(
99
'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~)+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}(+.147:=@CFILORUX[^adgjmpsvy|(+.147:=@CFILORUX[^adgjmpsvy|(+.147:=@CFILORUX[^adgjmpsvy|(,048<@DHLPTX\`dhlptx|)-159=AEIMQUY]aeimquy}*.26:>BFJNRVZ^bfjnrvz~+/37;?CGKOSW[_cgkosw{(-27<AFKPUZ_dinsx}+05:?DINSX]bglqv{).38=BGLQV[`ejoty~,16;@EJOTY^chmrw|*/49>CHMRW\afkpuz(.4:@FLRX^djpv|+17=CIOU[agmsy(.4:@FLRX^djpv|+17=CIOU[agmsy(.4:@FLRX^djpv|+17=CIOU[agmsy(/6=DKRY`gnu|,3:AHOV]dkry)07>ELSZahov}-4;BIPW^elsz*18?FMT[bipw~.5<CJQX_fmt{+29@GNU\cjqx(08@HPX`hpx)19AIQYaiqy*2:BJRZbjrz+3;CKS[cks{,4<DLT\dlt|-5=EMU]emu}.6>FNV^fnv~/7?GOW_gow(1:CLU^gpy+4=FOXajs|.7@IR[dmv(1:CLU^gpy+4=FOXajs|.7@IR[dmv(1:CLU^gpy+4=',
100
'FOXajs|.7@IR[dmv(2<FPZdnx+5?IS]gq{.8BLV`jt~1;EOYcmw*4>HR\fpz-7AKU_is}0:DNXblv)3=GQ[eoy,6@JT^hr|/9CMWaku(3>IT_ju)4?JU`kv*5@KValw+6ALWbmx,7BMXcny-8CNYdoz.9DOZep{/:EP[fq|0;FQ\gr}1<GR]hs~2=HS^it(4@LXdp|1=IUamy.:FR^jv+7CO[gs(4@LXdp|1=IUamy.:FR^jv+7CO[gs(4@LXdp|1=IUamy.:FR^jv+7CO[gs(5BO\iv,9FS`mz0=JWdq~4AN[hu+8ER_ly/<IVcp}3@MZgt*7DQ^kx.;HUbo|2?LYfs)6CP]jw-:GTan{1>KXer(6DR`n|3AO]ky0>LZhv-;IWes*8FTbp~5CQ_m{2@N\jx/=KYgu,:HVdr)7ESao}4BP^lz1?M[iw.<JXft+9GUcq(7FUds+:IXgv.=L[jy1@O^m|4CRap(7FUds+:IXgv.=L[jy1@O^m|4CRap(7FUds+:IXgv.=L[jy1@O^m|4CRap(8HXhx1AQaq*:JZjz3CScs,<L\l|5EUeu.>N^n~7GWgw0@P`p)9IYiy2BRbr+;K[k{4DTdt-=M]m}6FVfv/?O_o(9J[l}7HYj{5FWhy3DUfw1BSdu/@Qbs->O`q+<M^o):K\m~8IZk|6GXiz4EVgx2CTev0ARct.?Par,=N_p*;L]n(:L^p+=Oas.@Rdv1CUgy4FXj|7I[m(:L^p+=Oas.@Rdv1CUgy4FXj|7');
104
# Test innodb_file_format
106
set global innodb_file_format=`0`;
107
select @@innodb_file_format;
108
set global innodb_file_format=`1`;
109
select @@innodb_file_format;
110
-- error ER_WRONG_ARGUMENTS
111
set global innodb_file_format=`2`;
112
-- error ER_WRONG_ARGUMENTS
113
set global innodb_file_format=`-1`;
114
set global innodb_file_format=`Antelope`;
115
set global innodb_file_format=`Barracuda`;
116
-- error ER_WRONG_ARGUMENTS
117
set global innodb_file_format=`Cheetah`;
118
-- error ER_WRONG_ARGUMENTS
119
set global innodb_file_format=`abc`;
120
-- error ER_WRONG_ARGUMENTS
121
set global innodb_file_format=`1a`;
122
-- error ER_WRONG_ARGUMENTS
123
set global innodb_file_format=``;
127
set global innodb_file_per_table = on;
128
set global innodb_file_format = `1`;
131
set innodb_strict_mode = on;
133
#Test different values of KEY_BLOCK_SIZE
135
--error ER_CANT_CREATE_TABLE
136
create table t1 (id int primary key) engine = innodb key_block_size = 0;
139
--error ER_CANT_CREATE_TABLE
140
create table t2 (id int primary key) engine = innodb key_block_size = 9;
144
create table t3 (id int primary key) engine = innodb key_block_size = 1;
145
create table t4 (id int primary key) engine = innodb key_block_size = 2;
146
create table t5 (id int primary key) engine = innodb key_block_size = 4;
147
create table t6 (id int primary key) engine = innodb key_block_size = 8;
148
create table t7 (id int primary key) engine = innodb key_block_size = 16;
150
#check various ROW_FORMAT values.
151
create table t8 (id int primary key) engine = innodb row_format = compressed;
152
create table t9 (id int primary key) engine = innodb row_format = dynamic;
153
create table t10(id int primary key) engine = innodb row_format = compact;
154
create table t11(id int primary key) engine = innodb row_format = redundant;
156
SELECT table_schema, table_name, row_format
157
FROM information_schema.tables WHERE engine='innodb';
158
drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
160
#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
161
create table t1 (id int primary key) engine = innodb
162
key_block_size = 8 row_format = compressed;
164
--error ER_CANT_CREATE_TABLE
165
create table t2 (id int primary key) engine = innodb
166
key_block_size = 8 row_format = redundant;
169
--error ER_CANT_CREATE_TABLE
170
create table t3 (id int primary key) engine = innodb
171
key_block_size = 8 row_format = compact;
174
--error ER_CANT_CREATE_TABLE
175
create table t4 (id int primary key) engine = innodb
176
key_block_size = 8 row_format = dynamic;
179
--error ER_CANT_CREATE_TABLE
180
create table t5 (id int primary key) engine = innodb
181
key_block_size = 8 row_format = default;
184
SELECT table_schema, table_name, row_format
185
FROM information_schema.tables WHERE engine='innodb';
188
#test multiple errors
189
--error ER_CANT_CREATE_TABLE
190
create table t1 (id int primary key) engine = innodb
191
key_block_size = 9 row_format = redundant;
194
--error ER_CANT_CREATE_TABLE
195
create table t2 (id int primary key) engine = innodb
196
key_block_size = 9 row_format = compact;
199
--error ER_CANT_CREATE_TABLE
200
create table t2 (id int primary key) engine = innodb
201
key_block_size = 9 row_format = dynamic;
204
SELECT table_schema, table_name, row_format
205
FROM information_schema.tables WHERE engine='innodb';
207
#test valid values with innodb_file_per_table unset
208
set global innodb_file_per_table = off;
210
--error ER_CANT_CREATE_TABLE
211
create table t1 (id int primary key) engine = innodb key_block_size = 1;
213
--error ER_CANT_CREATE_TABLE
214
create table t2 (id int primary key) engine = innodb key_block_size = 2;
216
--error ER_CANT_CREATE_TABLE
217
create table t3 (id int primary key) engine = innodb key_block_size = 4;
219
--error ER_CANT_CREATE_TABLE
220
create table t4 (id int primary key) engine = innodb key_block_size = 8;
222
--error ER_CANT_CREATE_TABLE
223
create table t5 (id int primary key) engine = innodb key_block_size = 16;
225
--error ER_CANT_CREATE_TABLE
226
create table t6 (id int primary key) engine = innodb row_format = compressed;
228
--error ER_CANT_CREATE_TABLE
229
create table t7 (id int primary key) engine = innodb row_format = dynamic;
231
create table t8 (id int primary key) engine = innodb row_format = compact;
232
create table t9 (id int primary key) engine = innodb row_format = redundant;
234
SELECT table_schema, table_name, row_format
235
FROM information_schema.tables WHERE engine='innodb';
238
#test valid values with innodb_file_format unset
239
set global innodb_file_per_table = on;
240
set global innodb_file_format = `0`;
242
--error ER_CANT_CREATE_TABLE
243
create table t1 (id int primary key) engine = innodb key_block_size = 1;
245
--error ER_CANT_CREATE_TABLE
246
create table t2 (id int primary key) engine = innodb key_block_size = 2;
248
--error ER_CANT_CREATE_TABLE
249
create table t3 (id int primary key) engine = innodb key_block_size = 4;
251
--error ER_CANT_CREATE_TABLE
252
create table t4 (id int primary key) engine = innodb key_block_size = 8;
254
--error ER_CANT_CREATE_TABLE
255
create table t5 (id int primary key) engine = innodb key_block_size = 16;
257
--error ER_CANT_CREATE_TABLE
258
create table t6 (id int primary key) engine = innodb row_format = compressed;
260
--error ER_CANT_CREATE_TABLE
261
create table t7 (id int primary key) engine = innodb row_format = dynamic;
263
create table t8 (id int primary key) engine = innodb row_format = compact;
264
create table t9 (id int primary key) engine = innodb row_format = redundant;
266
SELECT table_schema, table_name, row_format
267
FROM information_schema.tables WHERE engine='innodb';
270
eval set global innodb_file_per_table=$per_table;
271
eval set global innodb_file_format=$format;
272
eval set innodb_strict_mode=$mode;
274
# Testing of tablespace tagging
277
set global innodb_file_per_table=on;
278
set global innodb_file_format=`Barracuda`;
279
set global innodb_file_format_check=`Antelope`;
280
create table normal_table (
283
select @@innodb_file_format_check;
284
create table zip_table (
286
) engine = innodb key_block_size = 8;
287
select @@innodb_file_format_check;
288
set global innodb_file_format_check=`Antelope`;
289
select @@innodb_file_format_check;
290
-- disable_result_log
293
select @@innodb_file_format_check;
294
-- error ER_WRONG_ARGUMENTS
295
set global innodb_file_format_check=`Cheetah`;
296
-- error ER_WRONG_ARGUMENTS
297
set global innodb_file_format_check=`on`;
298
-- error ER_WRONG_ARGUMENTS
299
set global innodb_file_format_check=`off`;
300
select @@innodb_file_format_check;
301
drop table normal_table, zip_table;
302
-- disable_result_log