~ubuntu-branches/ubuntu/utopic/mariadb-5.5/utopic-security

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb/t/innodb-zip.test

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen, Otto Kekäläinen, James Page
  • Date: 2014-03-02 01:38:26 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140302013826-z3afnfteqo86pccd
[ Otto Kekäläinen ]
* New upstream release.
* Updated Danish debconf translation (Closes: #739750).
* d/control: Added explicit Conflicts/Replaces for mysql-5.6 packages
  (Closes: #739841).
* d/control: Update for use of virtual-* packages for switching to/from
  MySQL alternatives.

[ James Page ]
* d/control: Drop Nicholas from Uploaders, MIA (Closes: #739360).
* d/control: Add libjemalloc-dev to BD's.

Show diffs side-by-side

added added

removed removed

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