~drizzle-trunk/drizzle/development

873.2.35 by Monty Taylor
Update tests based on how Toru's latest patch changes create table statements.
1
DROP TABLE IF EXISTS t1;
784.2.1 by Stewart Smith
fix strict test for drizzle.
2
CREATE TABLE t1 (col1 INT);
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
3
INSERT INTO t1 VALUES(-2147483648);
4
INSERT INTO t1 VALUES (0);
5
INSERT INTO t1 VALUES (2147483647);
6
INSERT INTO t1 VALUES ('-2147483648');
7
INSERT INTO t1 VALUES ('2147483647');
8
INSERT INTO t1 VALUES (-2147483648.0);
9
INSERT INTO t1 VALUES (2147483647.0);
1 by brian
clean slate
10
INSERT INTO t1 (col1) VALUES(-2147483649);
11
ERROR 22003: Out of range value for column 'col1' at row 1
12
INSERT INTO t1 (col1) VALUES(2147643648);
13
ERROR 22003: Out of range value for column 'col1' at row 1
14
INSERT INTO t1 (col1) VALUES('-2147483649');
15
ERROR 22003: Out of range value for column 'col1' at row 1
16
INSERT INTO t1 (col1) VALUES('2147643648');
17
ERROR 22003: Out of range value for column 'col1' at row 1
18
INSERT INTO t1 (col1) VALUES(-2147483649.0);
19
ERROR 22003: Out of range value for column 'col1' at row 1
20
INSERT INTO t1 (col1) VALUES(2147643648.0);
21
ERROR 22003: Out of range value for column 'col1' at row 1
22
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
23
ERROR 22003: Out of range value for column 'col1' at row 1
24
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
25
ERROR 22012: Division by 0
26
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
27
ERROR 22012: Division by 0
28
INSERT INTO t1 (col1) VALUES ('');
29
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
30
INSERT INTO t1 (col1) VALUES ('a59b');
31
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
32
INSERT INTO t1 (col1) VALUES ('1a');
33
ERROR 01000: Data truncated for column 'col1' at row 1
34
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
35
Warnings:
36
Warning	1265	Data truncated for column 'col1' at row 1
784.2.1 by Stewart Smith
fix strict test for drizzle.
37
INSERT IGNORE INTO t1 values (1/0);
1812.4.2 by Brian Aker
Fix issue with divide by zero not being an error.
38
ERROR 22012: Division by 0
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
39
INSERT IGNORE INTO t1 values (-2147483649);
40
Warnings:
41
Warning	1264	Out of range value for column 'col1' at row 1
42
INSERT IGNORE INTO t1 values (2147643648);
43
Warnings:
44
Warning	1264	Out of range value for column 'col1' at row 1
45
INSERT IGNORE INTO t1 values ('-2147483649');
46
Warnings:
47
Warning	1264	Out of range value for column 'col1' at row 1
48
INSERT IGNORE INTO t1 values ('2147643648');
49
Warnings:
50
Warning	1264	Out of range value for column 'col1' at row 1
51
INSERT IGNORE INTO t1 values (-2147483649.0);
52
Warnings:
53
Warning	1264	Out of range value for column 'col1' at row 1
54
INSERT IGNORE INTO t1 values (2147643648.0);
55
Warnings:
56
Warning	1264	Out of range value for column 'col1' at row 1
1 by brian
clean slate
57
SELECT * FROM t1;
784.2.1 by Stewart Smith
fix strict test for drizzle.
58
col1
59
-2147483648
60
0
61
2147483647
62
-2147483648
63
2147483647
64
-2147483648
65
2147483647
66
2
67
-2147483648
68
2147483647
69
-2147483648
70
2147483647
71
-2147483648
72
2147483647
1 by brian
clean slate
73
DROP TABLE t1;
784.2.1 by Stewart Smith
fix strict test for drizzle.
74
CREATE TABLE t1 (col1 BIGINT);
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
75
INSERT INTO t1 VALUES (-9223372036854775808);
76
INSERT INTO t1 VALUES (0);
77
INSERT INTO t1 VALUES (9223372036854775807);
78
INSERT INTO t1 VALUES ('-9223372036854775808');
79
INSERT INTO t1 VALUES ('9223372036854775807');
80
INSERT INTO t1 VALUES (-9223372036854774000.0);
81
INSERT INTO t1 VALUES (9223372036854775700.0);
1 by brian
clean slate
82
INSERT INTO t1 (col1) VALUES(-9223372036854775809);
83
ERROR 22003: Out of range value for column 'col1' at row 1
84
INSERT INTO t1 (col1) VALUES('-9223372036854775809');
85
ERROR 22003: Out of range value for column 'col1' at row 1
86
INSERT INTO t1 (col1) VALUES('9223372036854775808');
87
ERROR 22003: Out of range value for column 'col1' at row 1
88
INSERT INTO t1 (col1) VALUES(-9223372036854785809.0);
89
ERROR 22003: Out of range value for column 'col1' at row 1
90
INSERT INTO t1 (col1) VALUES(9223372036854785808.0);
91
ERROR 22003: Out of range value for column 'col1' at row 1
92
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
93
ERROR 22012: Division by 0
94
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
95
ERROR 22012: Division by 0
96
INSERT INTO t1 (col1) VALUES ('');
97
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
98
INSERT INTO t1 (col1) VALUES ('a59b');
99
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
100
INSERT INTO t1 (col1) VALUES ('1a');
101
ERROR 01000: Data truncated for column 'col1' at row 1
102
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
103
Warnings:
104
Warning	1265	Data truncated for column 'col1' at row 1
784.2.1 by Stewart Smith
fix strict test for drizzle.
105
INSERT IGNORE INTO t1 values (1/0);
1812.4.2 by Brian Aker
Fix issue with divide by zero not being an error.
106
ERROR 22012: Division by 0
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
107
INSERT IGNORE INTO t1 VALUES (-9223372036854775809);
108
Warnings:
109
Warning	1264	Out of range value for column 'col1' at row 1
110
INSERT IGNORE INTO t1 VALUES (9223372036854775808);
111
INSERT IGNORE INTO t1 VALUES ('-9223372036854775809');
112
Warnings:
113
Warning	1264	Out of range value for column 'col1' at row 1
114
INSERT IGNORE INTO t1 VALUES ('9223372036854775808');
115
Warnings:
116
Warning	1264	Out of range value for column 'col1' at row 1
117
INSERT IGNORE INTO t1 VALUES (-9223372036854785809.0);
118
Warnings:
119
Warning	1264	Out of range value for column 'col1' at row 1
120
INSERT IGNORE INTO t1 VALUES (9223372036854785808.0);
121
Warnings:
122
Warning	1264	Out of range value for column 'col1' at row 1
1 by brian
clean slate
123
SELECT * FROM t1;
784.2.1 by Stewart Smith
fix strict test for drizzle.
124
col1
125
-9223372036854775808
126
0
127
9223372036854775807
128
-9223372036854775808
129
9223372036854775807
130
-9223372036854774000
131
9223372036854775700
132
2
133
-9223372036854775808
134
-9223372036854775808
135
-9223372036854775808
136
9223372036854775807
137
-9223372036854775808
138
9223372036854775807
1 by brian
clean slate
139
DROP TABLE t1;
140
CREATE TABLE t1 (col1 NUMERIC(4,2));
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
141
INSERT INTO t1 VALUES (10.55);
142
INSERT INTO t1 VALUES (10.5555);
143
ERROR 01000: Data truncated for column 'col1' at row 1
144
INSERT INTO t1 VALUES (0);
145
INSERT INTO t1 VALUES (-10.55);
146
INSERT INTO t1 VALUES (-10.5555);
147
ERROR 01000: Data truncated for column 'col1' at row 1
148
INSERT INTO t1 VALUES (11);
149
INSERT INTO t1 VALUES (1e+01);
150
INSERT INTO t1 VALUES ('10.55');
151
INSERT INTO t1 VALUES ('10.5555');
152
ERROR 01000: Data truncated for column 'col1' at row 1
153
INSERT INTO t1 VALUES ('-10.55');
154
INSERT INTO t1 VALUES ('-10.5555');
155
ERROR 01000: Data truncated for column 'col1' at row 1
156
INSERT INTO t1 VALUES ('11');
157
INSERT INTO t1 VALUES ('1e+01');
1 by brian
clean slate
158
INSERT INTO t1 VALUES (101.55);
159
ERROR 22003: Out of range value for column 'col1' at row 1
160
INSERT INTO t1 VALUES (101);
161
ERROR 22003: Out of range value for column 'col1' at row 1
162
INSERT INTO t1 VALUES (-101.55);
163
ERROR 22003: Out of range value for column 'col1' at row 1
164
INSERT INTO t1 VALUES (1010.55);
165
ERROR 22003: Out of range value for column 'col1' at row 1
166
INSERT INTO t1 VALUES (1010);
167
ERROR 22003: Out of range value for column 'col1' at row 1
168
INSERT INTO t1 VALUES ('101.55');
169
ERROR 22003: Out of range value for column 'col1' at row 1
170
INSERT INTO t1 VALUES ('101');
171
ERROR 22003: Out of range value for column 'col1' at row 1
172
INSERT INTO t1 VALUES ('-101.55');
173
ERROR 22003: Out of range value for column 'col1' at row 1
174
INSERT INTO t1 VALUES ('-1010.55');
175
ERROR 22003: Out of range value for column 'col1' at row 1
176
INSERT INTO t1 VALUES ('-100E+1');
177
ERROR 22003: Out of range value for column 'col1' at row 1
178
INSERT INTO t1 VALUES ('-100E');
179
ERROR HY000: Incorrect decimal value: '-100E' for column 'col1' at row 1
180
UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11;
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
181
ERROR 22003: Out of range value for column 'col1' at row 4
1 by brian
clean slate
182
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
183
ERROR 22012: Division by 0
184
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
185
ERROR 22012: Division by 0
186
INSERT INTO t1 (col1) VALUES ('');
187
ERROR HY000: Incorrect decimal value: '' for column 'col1' at row 1
188
INSERT INTO t1 (col1) VALUES ('a59b');
189
ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1
190
INSERT INTO t1 (col1) VALUES ('1a');
191
ERROR HY000: Incorrect decimal value: '1a' for column 'col1' at row 1
192
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
193
Warnings:
970.2.4 by Padraig O'Sullivan
Updating 1 more test result based on my fix.
194
Warning	1265	Data truncated for column 'col1' at row 1
1 by brian
clean slate
195
INSERT IGNORE INTO t1 values (1/0);
1812.4.2 by Brian Aker
Fix issue with divide by zero not being an error.
196
ERROR 22012: Division by 0
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
197
INSERT IGNORE INTO t1 VALUES (1000);
198
Warnings:
199
Warning	1264	Out of range value for column 'col1' at row 1
200
INSERT IGNORE INTO t1 VALUES (-1000);
201
Warnings:
202
Warning	1264	Out of range value for column 'col1' at row 1
203
INSERT IGNORE INTO t1 VALUES ('1000');
204
Warnings:
205
Warning	1264	Out of range value for column 'col1' at row 1
206
INSERT IGNORE INTO t1 VALUES ('-1000');
207
Warnings:
208
Warning	1264	Out of range value for column 'col1' at row 1
209
INSERT IGNORE INTO t1 VALUES (1000.0);
210
Warnings:
211
Warning	1264	Out of range value for column 'col1' at row 1
212
INSERT IGNORE INTO t1 VALUES (-1000.0);
213
Warnings:
214
Warning	1264	Out of range value for column 'col1' at row 1
1 by brian
clean slate
215
UPDATE IGNORE t1 SET col1=1/NULL where col1=0;
216
SELECT * FROM t1;
217
col1
942.3.1 by Vladimir Kolesnikov
test generalizations
218
-10.55
219
-10.55
971.1.17 by Monty Taylor
Merged Padraig.
220
-99.99
221
-99.99
222
-99.99
223
10.00
224
10.00
225
10.55
226
10.55
227
11.00
228
11.00
229
99.99
942.3.1 by Vladimir Kolesnikov
test generalizations
230
99.99
231
99.99
232
99.99
233
NULL
1 by brian
clean slate
234
DROP TABLE t1;
235
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
236
INSERT INTO t1 VALUES ('hello', 'hello');
237
INSERT INTO t1 VALUES ('he', 'he');
238
INSERT INTO t1 VALUES ('hello   ', 'hello ');
1637 by Brian Aker
Merge in changes to call error on bad data input.
239
ERROR 22001: Data too long for column 'col1' at row 1
1 by brian
clean slate
240
INSERT INTO t1 (col1) VALUES ('hellobob');
241
ERROR 22001: Data too long for column 'col1' at row 1
242
INSERT INTO t1 (col2) VALUES ('hellobob');
243
ERROR 22001: Data too long for column 'col2' at row 1
244
INSERT INTO t1 (col2) VALUES ('hello  ');
1637 by Brian Aker
Merge in changes to call error on bad data input.
245
ERROR 22001: Data too long for column 'col2' at row 1
1 by brian
clean slate
246
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
247
ERROR 22001: Data too long for column 'col1' at row 2
248
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
249
ERROR 22001: Data too long for column 'col2' at row 2
250
INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob');
251
Warnings:
1637 by Brian Aker
Merge in changes to call error on bad data input.
252
Error	1406	Data too long for column 'col1' at row 1
253
Error	1406	Data too long for column 'col2' at row 1
1 by brian
clean slate
254
UPDATE IGNORE t1 SET col2 ='hellotrudy' WHERE col2 ='he';
255
Warnings:
1637 by Brian Aker
Merge in changes to call error on bad data input.
256
Error	1406	Data too long for column 'col2' at row 2
1 by brian
clean slate
257
SELECT * FROM t1;
258
col1	col2
942.3.1 by Vladimir Kolesnikov
test generalizations
259
he	hellot
1 by brian
clean slate
260
hello	hello
261
hello	hellob
262
DROP TABLE t1;
263
CREATE TABLE t1 (col1 enum('red','blue','green'));
970.2.5 by Padraig O'Sullivan
Added extra comments to parts of test cases that were modified for this bug
264
INSERT INTO t1 VALUES ('red');
265
INSERT INTO t1 VALUES ('blue');
266
INSERT INTO t1 VALUES ('green');
1 by brian
clean slate
267
INSERT INTO t1 (col1) VALUES ('yellow');
934.4.1 by Jay Pipes
Fixes ENUM field type to throw an error on bad data input. 0 is now not
268
ERROR HY000: Received an invalid enum value 'yellow'.
1 by brian
clean slate
269
INSERT INTO t1 (col1) VALUES ('redd');
934.4.1 by Jay Pipes
Fixes ENUM field type to throw an error on bad data input. 0 is now not
270
ERROR HY000: Received an invalid enum value 'redd'.
1 by brian
clean slate
271
INSERT INTO t1 VALUES ('');
934.4.1 by Jay Pipes
Fixes ENUM field type to throw an error on bad data input. 0 is now not
272
ERROR HY000: Received an invalid enum value ''.
1 by brian
clean slate
273
UPDATE t1 SET col1 ='yellow' WHERE col1 ='green';
934.4.1 by Jay Pipes
Fixes ENUM field type to throw an error on bad data input. 0 is now not
274
ERROR HY000: Received an invalid enum value 'yellow'.
1 by brian
clean slate
275
INSERT IGNORE INTO t1 VALUES ('yellow');
934.4.1 by Jay Pipes
Fixes ENUM field type to throw an error on bad data input. 0 is now not
276
ERROR HY000: Received an invalid enum value 'yellow'.
1 by brian
clean slate
277
UPDATE IGNORE t1 SET col1 ='yellow' WHERE col1 ='blue';
934.4.1 by Jay Pipes
Fixes ENUM field type to throw an error on bad data input. 0 is now not
278
ERROR HY000: Received an invalid enum value 'yellow'.
1 by brian
clean slate
279
SELECT * FROM t1;
280
col1
281
red
934.4.1 by Jay Pipes
Fixes ENUM field type to throw an error on bad data input. 0 is now not
282
blue
1 by brian
clean slate
283
green
284
DROP TABLE t1;
285
CREATE TABLE t1 (col1 INT NOT NULL, col2 CHAR(5) NOT NULL, col3 DATE NOT NULL);
286
INSERT INTO t1 VALUES (100, 'hello', '2004-08-20');
287
INSERT INTO t1 (col1,col2,col3) VALUES (101, 'hell2', '2004-08-21');
288
INSERT INTO t1 (col1,col2,col3) VALUES (NULL, '', '2004-01-01');
289
ERROR 23000: Column 'col1' cannot be null
290
INSERT INTO t1 (col1,col2,col3) VALUES (102, NULL, '2004-01-01');
291
ERROR 23000: Column 'col2' cannot be null
292
INSERT INTO t1 VALUES (103,'',NULL);
293
ERROR 23000: Column 'col3' cannot be null
294
UPDATE t1 SET col1=NULL WHERE col1 =100;
295
ERROR 23000: Column 'col1' cannot be null
296
UPDATE t1 SET col2 =NULL WHERE col2 ='hello';
297
ERROR 23000: Column 'col2' cannot be null
298
UPDATE t1 SET col2 =NULL where col3 IS NOT NULL;
299
ERROR 23000: Column 'col2' cannot be null
300
INSERT IGNORE INTO t1 values (NULL,NULL,NULL);
301
Warnings:
302
Warning	1048	Column 'col1' cannot be null
303
Warning	1048	Column 'col2' cannot be null
304
Warning	1048	Column 'col3' cannot be null
305
SELECT * FROM t1;
306
col1	col2	col3
307
100	hello	2004-08-20
308
101	hell2	2004-08-21
309
0		0000-00-00
310
DROP TABLE t1;
311
CREATE TABLE t1 (col1 INT NOT NULL default 99, col2 CHAR(6) NOT NULL);
312
SHOW CREATE TABLE t1;
313
Table	Create Table
784.2.1 by Stewart Smith
fix strict test for drizzle.
314
t1	CREATE TABLE `t1` (
1743.5.2 by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output
315
  `col1` INT NOT NULL DEFAULT '99',
316
  `col2` VARCHAR(6) COLLATE utf8_general_ci NOT NULL
1638.10.88 by Stewart Smith
fix SHOW CREATE TABLE tests for explicit COLLATE in CREATE TABLE
317
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1 by brian
clean slate
318
INSERT INTO t1 VALUES (1, 'hello');
319
INSERT INTO t1 (col2) VALUES ('hello2');
320
INSERT INTO t1 (col2) VALUES (NULL);
321
ERROR 23000: Column 'col2' cannot be null
322
INSERT INTO t1 (col1) VALUES (2);
323
ERROR HY000: Field 'col2' doesn't have a default value
324
INSERT INTO t1 VALUES(default(col1),default(col2));
325
ERROR HY000: Field 'col2' doesn't have a default value
326
INSERT INTO t1 (col1) SELECT 1;
327
ERROR HY000: Field 'col2' doesn't have a default value
328
INSERT INTO t1 SELECT 1,NULL;
329
ERROR 23000: Column 'col2' cannot be null
330
INSERT IGNORE INTO t1 values (NULL,NULL);
331
Warnings:
332
Warning	1048	Column 'col1' cannot be null
333
Warning	1048	Column 'col2' cannot be null
334
INSERT IGNORE INTO t1 (col1) values (3);
784.2.1 by Stewart Smith
fix strict test for drizzle.
335
ERROR HY000: Field 'col2' doesn't have a default value
1 by brian
clean slate
336
INSERT IGNORE INTO t1 () values ();
784.2.1 by Stewart Smith
fix strict test for drizzle.
337
ERROR HY000: Field 'col2' doesn't have a default value
1 by brian
clean slate
338
SELECT * FROM t1;
339
col1	col2
340
1	hello
341
99	hello2
342
0	
343
DROP TABLE t1;
344
create table t1 (charcol char(255), varcharcol varchar(255),
784.2.1 by Stewart Smith
fix strict test for drizzle.
345
varbinarycol varbinary(255));
1 by brian
clean slate
346
insert into t1 (charcol) values (repeat('x',256));
347
ERROR 22001: Data too long for column 'charcol' at row 1
348
insert into t1 (varcharcol) values (repeat('x',256));
349
ERROR 22001: Data too long for column 'varcharcol' at row 1
350
insert into t1 (varbinarycol) values (repeat('x',256));
351
ERROR 22001: Data too long for column 'varbinarycol' at row 1
352
select * from t1;
784.2.1 by Stewart Smith
fix strict test for drizzle.
353
charcol	varcharcol	varbinarycol
1 by brian
clean slate
354
drop table t1;
355
create table t1 (col1 char(3), col2 integer);
356
insert into t1 (col1) values (cast(1000 as char(3)));
357
ERROR 22007: Truncated incorrect CHAR(3) value: '1000'
358
insert into t1 (col1) values (cast(1000E+0 as char(3)));
359
ERROR 22007: Truncated incorrect CHAR(3) value: '1000'
360
insert into t1 (col1) values (cast(1000.0 as char(3)));
361
ERROR 22007: Truncated incorrect CHAR(3) value: '1000.0'
784.2.1 by Stewart Smith
fix strict test for drizzle.
362
insert into t1 (col2) values (cast('abc' as DECIMAL));
363
ERROR 22007: Truncated incorrect DECIMAL value: 'abc'
1 by brian
clean slate
364
insert into t1 (col2) values (10E+0 + 'a');
365
ERROR 22007: Truncated incorrect DOUBLE value: 'a'
784.2.1 by Stewart Smith
fix strict test for drizzle.
366
insert into t1 (col2) values ('10a');
367
ERROR 01000: Data truncated for column 'col2' at row 1
368
insert into t1 (col2) values (cast('10a' as DECIMAL));
369
insert into t1 (col2) values (cast('10' as DECIMAL));
370
insert into t1 (col2) values (cast('10' as DECIMAL));
1 by brian
clean slate
371
insert into t1 (col2) values (10E+0 + '0 ');
372
select * from t1;
373
col1	col2
374
NULL	10
375
NULL	10
376
NULL	10
784.2.1 by Stewart Smith
fix strict test for drizzle.
377
NULL	10
378
drop table t1;
379
CREATE TABLE t1 (i int not null);
380
INSERT INTO t1 VALUES ();
381
ERROR HY000: Field 'i' doesn't have a default value
382
INSERT INTO t1 VALUES (DEFAULT);
383
ERROR HY000: Field 'i' doesn't have a default value
384
INSERT INTO t1 VALUES (DEFAULT(i));
385
ERROR HY000: Field 'i' doesn't have a default value
386
ALTER TABLE t1 ADD j int;
387
INSERT INTO t1 SET j = 1;
388
ERROR HY000: Field 'i' doesn't have a default value
389
INSERT INTO t1 SET j = 1, i = DEFAULT;
390
ERROR HY000: Field 'i' doesn't have a default value
391
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
392
ERROR HY000: Field 'i' doesn't have a default value
393
INSERT INTO t1 VALUES (DEFAULT,1);
394
ERROR HY000: Field 'i' doesn't have a default value
395
DROP TABLE t1;
396
CREATE TABLE t1 (i int not null);
397
INSERT INTO t1 VALUES ();
398
ERROR HY000: Field 'i' doesn't have a default value
399
INSERT INTO t1 VALUES (DEFAULT);
400
ERROR HY000: Field 'i' doesn't have a default value
401
INSERT INTO t1 VALUES (DEFAULT(i));
402
ERROR HY000: Field 'i' doesn't have a default value
403
ALTER TABLE t1 ADD j int;
404
INSERT INTO t1 SET j = 1;
405
ERROR HY000: Field 'i' doesn't have a default value
406
INSERT INTO t1 SET j = 1, i = DEFAULT;
407
ERROR HY000: Field 'i' doesn't have a default value
408
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
409
ERROR HY000: Field 'i' doesn't have a default value
410
INSERT INTO t1 VALUES (DEFAULT,1);
411
ERROR HY000: Field 'i' doesn't have a default value
412
DROP TABLE t1;
1 by brian
clean slate
413
create table t1(a varchar(65537));
784.2.1 by Stewart Smith
fix strict test for drizzle.
414
ERROR 42000: Column length too big for column 'a' (max = 16383); use BLOB or TEXT instead
1 by brian
clean slate
415
create table t1(a varbinary(65537));
416
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
417
create table t1(a int, b date not null);
784.2.1 by Stewart Smith
fix strict test for drizzle.
418
alter table t1 modify a bigint not null;
1 by brian
clean slate
419
show create table t1;
420
Table	Create Table
421
t1	CREATE TABLE `t1` (
1743.5.2 by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output
422
  `a` BIGINT NOT NULL,
423
  `b` DATE NOT NULL
1638.10.88 by Stewart Smith
fix SHOW CREATE TABLE tests for explicit COLLATE in CREATE TABLE
424
) ENGINE=DEFAULT COLLATE = utf8_general_ci
784.2.1 by Stewart Smith
fix strict test for drizzle.
425
drop table t1;
1 by brian
clean slate
426
create table t1(a int, b timestamp);
427
alter table t1 add primary key(a);
428
show create table t1;
429
Table	Create Table
430
t1	CREATE TABLE `t1` (
1743.5.2 by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output
431
  `a` INT NOT NULL,
432
  `b` TIMESTAMP NULL DEFAULT NULL,
1 by brian
clean slate
433
  PRIMARY KEY (`a`)
1638.10.88 by Stewart Smith
fix SHOW CREATE TABLE tests for explicit COLLATE in CREATE TABLE
434
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1 by brian
clean slate
435
drop table t1;
436
create table t1(a int, b timestamp default 20050102030405);
437
alter table t1 add primary key(a);
438
show create table t1;
439
Table	Create Table
440
t1	CREATE TABLE `t1` (
1743.5.2 by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output
441
  `a` INT NOT NULL,
442
  `b` TIMESTAMP NULL DEFAULT '2005-01-02 03:04:05',
1 by brian
clean slate
443
  PRIMARY KEY (`a`)
1638.10.88 by Stewart Smith
fix SHOW CREATE TABLE tests for explicit COLLATE in CREATE TABLE
444
) ENGINE=DEFAULT COLLATE = utf8_general_ci
784.2.1 by Stewart Smith
fix strict test for drizzle.
445
drop table t1;
1 by brian
clean slate
446
create table t1 (date date not null);
447
create table t2 select date from t1;
448
show create table t2;
449
Table	Create Table
450
t2	CREATE TABLE `t2` (
1743.5.2 by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output
451
  `date` DATE NOT NULL
1638.10.88 by Stewart Smith
fix SHOW CREATE TABLE tests for explicit COLLATE in CREATE TABLE
452
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1 by brian
clean slate
453
drop table t2,t1;
454
create table t1 (i int)
1245.3.4 by Stewart Smith
make the equals of KEY=VALUE required for CREATE TABLE options
455
comment='123456789*123456789*123456789*123456789*123456789*123456789*';
1 by brian
clean slate
456
show create table t1;
457
Table	Create Table
458
t1	CREATE TABLE `t1` (
1743.5.2 by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output
459
  `i` INT DEFAULT NULL
1638.10.88 by Stewart Smith
fix SHOW CREATE TABLE tests for explicit COLLATE in CREATE TABLE
460
) ENGINE=DEFAULT COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*' COLLATE = utf8_general_ci
1 by brian
clean slate
461
drop table t1;
784.2.1 by Stewart Smith
fix strict test for drizzle.
462
create table t1(col1 int, col2 int, 
463
col3 int, col4 int,
464
col7 int, col8 int,
465
col9 bigint, col10 bigint);
1 by brian
clean slate
466
insert into t1(col1) values('-');
467
ERROR HY000: Incorrect integer value: '-' for column 'col1' at row 1
468
insert into t1(col2) values('+');
469
ERROR HY000: Incorrect integer value: '+' for column 'col2' at row 1
470
insert into t1(col3) values('-');
471
ERROR HY000: Incorrect integer value: '-' for column 'col3' at row 1
472
insert into t1(col4) values('+');
473
ERROR HY000: Incorrect integer value: '+' for column 'col4' at row 1
474
insert into t1(col7) values('-');
475
ERROR HY000: Incorrect integer value: '-' for column 'col7' at row 1
476
insert into t1(col8) values('+');
477
ERROR HY000: Incorrect integer value: '+' for column 'col8' at row 1
478
insert into t1(col9) values('-');
479
ERROR HY000: Incorrect integer value: '-' for column 'col9' at row 1
480
insert into t1(col10) values('+');
481
ERROR HY000: Incorrect integer value: '+' for column 'col10' at row 1
482
drop table t1;
483
create table t1 (f1 enum('a','a'));
484
ERROR HY000: Column 'f1' has duplicated value 'a' in ENUM
485
End of 5.0 tests