1
set @org_mode=@@sql_mode;
2
set @@sql_mode='ansi,traditional';
5
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
6
DROP TABLE IF EXISTS t1, t2;
7
CREATE TABLE t1 (col1 date);
8
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
9
INSERT INTO t1 VALUES('0000-10-31');
10
INSERT INTO t1 VALUES('2004-0-31');
11
ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 1
12
INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31');
13
ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 2
14
INSERT INTO t1 VALUES('2004-10-0');
15
ERROR 22007: Incorrect date value: '2004-10-0' for column 'col1' at row 1
16
INSERT INTO t1 VALUES('2004-09-31');
17
ERROR 22007: Incorrect date value: '2004-09-31' for column 'col1' at row 1
18
INSERT INTO t1 VALUES('2004-10-32');
19
ERROR 22007: Incorrect date value: '2004-10-32' for column 'col1' at row 1
20
INSERT INTO t1 VALUES('2003-02-29');
21
ERROR 22007: Incorrect date value: '2003-02-29' for column 'col1' at row 1
22
INSERT INTO t1 VALUES('2004-13-15');
23
ERROR 22007: Incorrect date value: '2004-13-15' for column 'col1' at row 1
24
INSERT INTO t1 VALUES('0000-00-00');
25
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
26
INSERT INTO t1 VALUES ('59');
27
ERROR 22007: Incorrect date value: '59' for column 'col1' at row 1
28
set @@sql_mode='STRICT_ALL_TABLES';
29
INSERT INTO t1 VALUES('2004-01-03'),('2004-0-31');
30
set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_IN_DATE';
31
INSERT INTO t1 VALUES('2004-0-30');
32
ERROR 22007: Incorrect date value: '2004-0-30' for column 'col1' at row 1
33
INSERT INTO t1 VALUES('2004-01-04'),('2004-0-31'),('2004-01-05');
34
ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 2
35
INSERT INTO t1 VALUES('0000-00-00');
36
INSERT IGNORE INTO t1 VALUES('2004-0-29');
38
Warning 1265 Data truncated for column 'col1' at row 1
39
set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_DATE';
40
INSERT INTO t1 VALUES('0000-00-00');
41
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
42
INSERT IGNORE INTO t1 VALUES('0000-00-00');
44
Warning 1265 Data truncated for column 'col1' at row 1
45
INSERT INTO t1 VALUES ('2004-0-30');
46
INSERT INTO t1 VALUES ('2004-2-30');
47
ERROR 22007: Incorrect date value: '2004-2-30' for column 'col1' at row 1
48
set @@sql_mode='STRICT_ALL_TABLES,ALLOW_INVALID_DATES';
49
INSERT INTO t1 VALUES ('2004-2-30');
50
set @@sql_mode='ansi,traditional';
51
INSERT IGNORE INTO t1 VALUES('2004-02-29'),('2004-13-15'),('0000-00-00');
53
Warning 1265 Data truncated for column 'col1' at row 2
54
Warning 1265 Data truncated for column 'col1' at row 3
73
set @@sql_mode='strict_trans_tables';
74
CREATE TABLE t1 (col1 date) engine=myisam;
75
INSERT INTO t1 VALUES('2004-13-31'),('2004-1-1');
76
ERROR 22007: Incorrect date value: '2004-13-31' for column 'col1' at row 1
77
INSERT INTO t1 VALUES ('2004-1-2'), ('2004-13-31'),('2004-1-3');
79
Warning 1265 Data truncated for column 'col1' at row 2
80
INSERT IGNORE INTO t1 VALUES('2004-13-31'),('2004-1-4');
82
Warning 1265 Data truncated for column 'col1' at row 1
83
INSERT INTO t1 VALUES ('2003-02-29');
84
ERROR 22007: Incorrect date value: '2003-02-29' for column 'col1' at row 1
85
INSERT ignore INTO t1 VALUES('2003-02-30');
87
Warning 1265 Data truncated for column 'col1' at row 1
88
set @@sql_mode='STRICT_ALL_TABLES,ALLOW_INVALID_DATES';
89
INSERT ignore INTO t1 VALUES('2003-02-31');
100
set @@sql_mode='strict_trans_tables';
101
CREATE TABLE t1 (col1 date) engine=innodb;
102
INSERT INTO t1 VALUES('2004-13-31'),('2004-1-1');
103
ERROR 22007: Incorrect date value: '2004-13-31' for column 'col1' at row 1
104
INSERT INTO t1 VALUES ('2004-1-2'), ('2004-13-31'),('2004-1-3');
105
ERROR 22007: Incorrect date value: '2004-13-31' for column 'col1' at row 2
106
INSERT IGNORE INTO t1 VALUES('2004-13-31'),('2004-1-4');
108
Warning 1265 Data truncated for column 'col1' at row 1
109
INSERT INTO t1 VALUES ('2003-02-29');
110
ERROR 22007: Incorrect date value: '2003-02-29' for column 'col1' at row 1
111
INSERT ignore INTO t1 VALUES('2003-02-30');
113
Warning 1265 Data truncated for column 'col1' at row 1
114
set @@sql_mode='STRICT_ALL_TABLES,ALLOW_INVALID_DATES';
115
INSERT ignore INTO t1 VALUES('2003-02-31');
123
set @@sql_mode='ansi,traditional';
124
CREATE TABLE t1 (col1 datetime);
125
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
126
INSERT INTO t1 VALUES('0000-10-31 15:30:00');
127
INSERT INTO t1 VALUES('2004-0-31 15:30:00');
128
ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1
129
INSERT INTO t1 VALUES('2004-10-0 15:30:00');
130
ERROR 22007: Incorrect datetime value: '2004-10-0 15:30:00' for column 'col1' at row 1
131
INSERT INTO t1 VALUES('2004-09-31 15:30:00');
132
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col1' at row 1
133
INSERT INTO t1 VALUES('2004-10-32 15:30:00');
134
ERROR 22007: Incorrect datetime value: '2004-10-32 15:30:00' for column 'col1' at row 1
135
INSERT INTO t1 VALUES('2003-02-29 15:30:00');
136
ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col1' at row 1
137
INSERT INTO t1 VALUES('2004-13-15 15:30:00');
138
ERROR 22007: Incorrect datetime value: '2004-13-15 15:30:00' for column 'col1' at row 1
139
INSERT INTO t1 VALUES('0000-00-00 15:30:00');
140
ERROR 22007: Incorrect datetime value: '0000-00-00 15:30:00' for column 'col1' at row 1
141
INSERT INTO t1 VALUES ('59');
142
ERROR 22007: Incorrect datetime value: '59' for column 'col1' at row 1
149
CREATE TABLE t1 (col1 timestamp);
150
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
151
INSERT INTO t1 VALUES('0000-10-31 15:30:00');
152
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col1' at row 1
153
INSERT INTO t1 VALUES('2004-0-31 15:30:00');
154
ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1
155
INSERT INTO t1 VALUES('2004-10-0 15:30:00');
156
ERROR 22007: Incorrect datetime value: '2004-10-0 15:30:00' for column 'col1' at row 1
157
INSERT INTO t1 VALUES('2004-09-31 15:30:00');
158
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col1' at row 1
159
INSERT INTO t1 VALUES('2004-10-32 15:30:00');
160
ERROR 22007: Incorrect datetime value: '2004-10-32 15:30:00' for column 'col1' at row 1
161
INSERT INTO t1 VALUES('2003-02-29 15:30:00');
162
ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col1' at row 1
163
INSERT INTO t1 VALUES('2004-13-15 15:30:00');
164
ERROR 22007: Incorrect datetime value: '2004-13-15 15:30:00' for column 'col1' at row 1
165
INSERT INTO t1 VALUES('2004-02-29 25:30:00');
166
ERROR 22007: Incorrect datetime value: '2004-02-29 25:30:00' for column 'col1' at row 1
167
INSERT INTO t1 VALUES('2004-02-29 15:65:00');
168
ERROR 22007: Incorrect datetime value: '2004-02-29 15:65:00' for column 'col1' at row 1
169
INSERT INTO t1 VALUES('2004-02-29 15:31:61');
170
ERROR 22007: Incorrect datetime value: '2004-02-29 15:31:61' for column 'col1' at row 1
171
INSERT INTO t1 VALUES('0000-00-00 15:30:00');
172
ERROR 22007: Incorrect datetime value: '0000-00-00 15:30:00' for column 'col1' at row 1
173
INSERT INTO t1 VALUES('0000-00-00 00:00:00');
174
ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'col1' at row 1
175
INSERT IGNORE INTO t1 VALUES('0000-00-00 00:00:00');
177
Warning 1265 Data truncated for column 'col1' at row 1
178
INSERT INTO t1 VALUES ('59');
179
ERROR 22007: Incorrect datetime value: '59' for column 'col1' at row 1
180
set @@sql_mode='STRICT_ALL_TABLES,ALLOW_INVALID_DATES';
181
INSERT INTO t1 VALUES('2004-0-31 15:30:00');
182
ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1
183
INSERT INTO t1 VALUES('2004-10-0 15:30:00');
184
ERROR 22007: Incorrect datetime value: '2004-10-0 15:30:00' for column 'col1' at row 1
185
INSERT INTO t1 VALUES('2004-10-32 15:30:00');
186
ERROR 22007: Incorrect datetime value: '2004-10-32 15:30:00' for column 'col1' at row 1
187
INSERT INTO t1 VALUES('2004-02-30 15:30:04');
188
ERROR 22007: Incorrect datetime value: '2004-02-30 15:30:04' for column 'col1' at row 1
189
INSERT INTO t1 VALUES('0000-00-00 00:00:00');
190
set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_IN_DATE';
191
INSERT INTO t1 VALUES('0000-00-00 00:00:00');
192
set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_DATE';
193
INSERT INTO t1 VALUES('0000-00-00 00:00:00');
194
ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'col1' at row 1
195
set @@sql_mode='ansi,traditional';
204
CREATE TABLE t1 (col1 date, col2 datetime, col3 timestamp);
205
INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
206
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
207
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
208
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
210
Note 1265 Data truncated for column 'col1' at row 1
211
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
212
ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1
213
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
214
ERROR 22007: Incorrect date value: '2004-10-00 15:30:00' for column 'col1' at row 1
215
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
216
ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1
217
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
218
ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
219
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i'));
220
ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at row 1
221
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
222
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
223
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
224
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
225
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
226
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
227
ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1
228
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
229
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
230
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
231
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1
232
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
233
ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
234
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i'));
235
ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' at row 1
236
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
237
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
238
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
239
ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col2' at row 1
240
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
241
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
242
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
243
ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col3' at row 1
244
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
245
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
246
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
247
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1
248
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
249
ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
250
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i'));
251
ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' at row 1
252
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
253
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
254
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
255
ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col3' at row 1
257
CREATE TABLE t1 (col1 date, col2 datetime, col3 timestamp);
258
INSERT INTO t1 (col1) VALUES (CAST('2004-10-15' AS DATE));
259
INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
260
INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
261
INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE));
262
INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE));
263
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
264
INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE));
265
ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
266
INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE));
267
ERROR 22007: Incorrect datetime value: '0000-00-00'
268
INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
269
INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
270
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
271
INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
272
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' at row 1
273
INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
274
ERROR 22007: Incorrect datetime value: '0000-00-00'
275
INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
276
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
277
INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
278
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
279
INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
280
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col3' at row 1
281
INSERT INTO t1 (col3) VALUES(CAST('0000-00-00' AS DATETIME));
282
ERROR 22007: Incorrect datetime value: '0000-00-00'
284
CREATE TABLE t1 (col1 date, col2 datetime, col3 timestamp);
285
INSERT INTO t1 (col1) VALUES (CONVERT('2004-10-15',DATE));
286
INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
287
INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
288
INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE));
289
INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE));
290
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
291
INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE));
292
ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
293
INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE));
294
ERROR 22007: Incorrect datetime value: '0000-00-00'
295
INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
296
INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
297
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
298
INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
299
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' at row 1
300
INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
301
ERROR 22007: Incorrect datetime value: '0000-00-00'
302
INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
303
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
304
INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
305
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
306
INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
307
ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col3' at row 1
308
INSERT INTO t1 (col3) VALUES(CONVERT('0000-00-00',DATETIME));
309
ERROR 22007: Incorrect datetime value: '0000-00-00'
311
CREATE TABLE t1(col1 TINYINT, col2 TINYINT UNSIGNED);
312
INSERT INTO t1 VALUES(-128,0),(0,0),(127,255),('-128','0'),('0','0'),('127','255'),(-128.0,0.0),(0.0,0.0),(127.0,255.0);
313
SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 2;
318
Error 1365 Division by 0
319
Error 1365 Division by 0
320
INSERT INTO t1 (col1) VALUES(-129);
321
ERROR 22003: Out of range value for column 'col1' at row 1
322
INSERT INTO t1 (col1) VALUES(128);
323
ERROR 22003: Out of range value for column 'col1' at row 1
324
INSERT INTO t1 (col2) VALUES(-1);
325
ERROR 22003: Out of range value for column 'col2' at row 1
326
INSERT INTO t1 (col2) VALUES(256);
327
ERROR 22003: Out of range value for column 'col2' at row 1
328
INSERT INTO t1 (col1) VALUES('-129');
329
ERROR 22003: Out of range value for column 'col1' at row 1
330
INSERT INTO t1 (col1) VALUES('128');
331
ERROR 22003: Out of range value for column 'col1' at row 1
332
INSERT INTO t1 (col2) VALUES('-1');
333
ERROR 22003: Out of range value for column 'col2' at row 1
334
INSERT INTO t1 (col2) VALUES('256');
335
ERROR 22003: Out of range value for column 'col2' at row 1
336
INSERT INTO t1 (col1) VALUES(128.0);
337
ERROR 22003: Out of range value for column 'col1' at row 1
338
INSERT INTO t1 (col2) VALUES(-1.0);
339
ERROR 22003: Out of range value for column 'col2' at row 1
340
INSERT INTO t1 (col2) VALUES(256.0);
341
ERROR 22003: Out of range value for column 'col2' at row 1
342
SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 1;
346
Error 1365 Division by 0
347
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
348
ERROR 22003: Out of range value for column 'col1' at row 1
349
UPDATE t1 SET col2=col2 + 50 WHERE col2 > 0;
350
ERROR 22003: Out of range value for column 'col2' at row 3
351
UPDATE t1 SET col1=col1 / 0 WHERE col1 > 0;
352
ERROR 22012: Division by 0
353
set @@sql_mode='ERROR_FOR_DIVISION_BY_ZERO';
354
INSERT INTO t1 values (1/0,1/0);
356
Error 1365 Division by 0
357
Error 1365 Division by 0
358
set @@sql_mode='ansi,traditional';
359
SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 2;
364
Error 1365 Division by 0
365
Error 1365 Division by 0
366
INSERT INTO t1 (col1) VALUES ('');
367
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
368
INSERT INTO t1 (col1) VALUES ('a59b');
369
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
370
INSERT INTO t1 (col1) VALUES ('1a');
371
ERROR 01000: Data truncated for column 'col1' at row 1
372
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
374
Warning 1265 Data truncated for column 'col1' at row 1
375
INSERT IGNORE INTO t1 values (1/0,1/0);
377
Error 1365 Division by 0
378
Error 1365 Division by 0
379
set @@sql_mode='ansi';
380
INSERT INTO t1 values (1/0,1/0);
381
set @@sql_mode='ansi,traditional';
382
INSERT IGNORE INTO t1 VALUES('-129','-1'),('128','256');
384
Warning 1264 Out of range value for column 'col1' at row 1
385
Warning 1264 Out of range value for column 'col2' at row 1
386
Warning 1264 Out of range value for column 'col1' at row 2
387
Warning 1264 Out of range value for column 'col2' at row 2
388
INSERT IGNORE INTO t1 VALUES(-129.0,-1.0),(128.0,256.0);
390
Warning 1264 Out of range value for column 'col1' at row 1
391
Warning 1264 Out of range value for column 'col2' at row 1
392
Warning 1264 Out of range value for column 'col1' at row 2
393
Warning 1264 Out of range value for column 'col2' at row 2
394
UPDATE IGNORE t1 SET col2=1/NULL where col1=0;
415
CREATE TABLE t1(col1 SMALLINT, col2 SMALLINT UNSIGNED);
416
INSERT INTO t1 VALUES(-32768,0),(0,0),(32767,65535),('-32768','0'),('32767','65535'),(-32768.0,0.0),(32767.0,65535.0);
417
INSERT INTO t1 (col1) VALUES(-32769);
418
ERROR 22003: Out of range value for column 'col1' at row 1
419
INSERT INTO t1 (col1) VALUES(32768);
420
ERROR 22003: Out of range value for column 'col1' at row 1
421
INSERT INTO t1 (col2) VALUES(-1);
422
ERROR 22003: Out of range value for column 'col2' at row 1
423
INSERT INTO t1 (col2) VALUES(65536);
424
ERROR 22003: Out of range value for column 'col2' at row 1
425
INSERT INTO t1 (col1) VALUES('-32769');
426
ERROR 22003: Out of range value for column 'col1' at row 1
427
INSERT INTO t1 (col1) VALUES('32768');
428
ERROR 22003: Out of range value for column 'col1' at row 1
429
INSERT INTO t1 (col2) VALUES('-1');
430
ERROR 22003: Out of range value for column 'col2' at row 1
431
INSERT INTO t1 (col2) VALUES('65536');
432
ERROR 22003: Out of range value for column 'col2' at row 1
433
INSERT INTO t1 (col1) VALUES(-32769.0);
434
ERROR 22003: Out of range value for column 'col1' at row 1
435
INSERT INTO t1 (col1) VALUES(32768.0);
436
ERROR 22003: Out of range value for column 'col1' at row 1
437
INSERT INTO t1 (col2) VALUES(-1.0);
438
ERROR 22003: Out of range value for column 'col2' at row 1
439
INSERT INTO t1 (col2) VALUES(65536.0);
440
ERROR 22003: Out of range value for column 'col2' at row 1
441
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
442
ERROR 22003: Out of range value for column 'col1' at row 1
443
UPDATE t1 SET col2 = col2 + 50 WHERE col2 > 0;
444
ERROR 22003: Out of range value for column 'col2' at row 3
445
UPDATE t1 SET col1 = col1 / 0 WHERE col1 > 0;
446
ERROR 22012: Division by 0
447
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
448
ERROR 22012: Division by 0
449
INSERT INTO t1 (col1) VALUES ('');
450
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
451
INSERT INTO t1 (col1) VALUES ('a59b');
452
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
453
INSERT INTO t1 (col1) VALUES ('1a');
454
ERROR 01000: Data truncated for column 'col1' at row 1
455
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
457
Warning 1265 Data truncated for column 'col1' at row 1
458
INSERT IGNORE INTO t1 values (1/0,1/0);
460
Error 1365 Division by 0
461
Error 1365 Division by 0
462
INSERT IGNORE INTO t1 VALUES(-32769,-1),(32768,65536);
464
Warning 1264 Out of range value for column 'col1' at row 1
465
Warning 1264 Out of range value for column 'col2' at row 1
466
Warning 1264 Out of range value for column 'col1' at row 2
467
Warning 1264 Out of range value for column 'col2' at row 2
468
INSERT IGNORE INTO t1 VALUES('-32769','-1'),('32768','65536');
470
Warning 1264 Out of range value for column 'col1' at row 1
471
Warning 1264 Out of range value for column 'col2' at row 1
472
Warning 1264 Out of range value for column 'col1' at row 2
473
Warning 1264 Out of range value for column 'col2' at row 2
474
INSERT IGNORE INTO t1 VALUES(-32769,-1.0),(32768.0,65536.0);
476
Warning 1264 Out of range value for column 'col1' at row 1
477
Warning 1264 Out of range value for column 'col2' at row 1
478
Warning 1264 Out of range value for column 'col1' at row 2
479
Warning 1264 Out of range value for column 'col2' at row 2
480
UPDATE IGNORE t1 SET col2=1/NULL where col1=0;
499
CREATE TABLE t1 (col1 MEDIUMINT, col2 MEDIUMINT UNSIGNED);
500
INSERT INTO t1 VALUES(-8388608,0),(0,0),(8388607,16777215),('-8388608','0'),('8388607','16777215'),(-8388608.0,0.0),(8388607.0,16777215.0);
501
INSERT INTO t1 (col1) VALUES(-8388609);
502
ERROR 22003: Out of range value for column 'col1' at row 1
503
INSERT INTO t1 (col1) VALUES(8388608);
504
ERROR 22003: Out of range value for column 'col1' at row 1
505
INSERT INTO t1 (col2) VALUES(-1);
506
ERROR 22003: Out of range value for column 'col2' at row 1
507
INSERT INTO t1 (col2) VALUES(16777216);
508
ERROR 22003: Out of range value for column 'col2' at row 1
509
INSERT INTO t1 (col1) VALUES('-8388609');
510
ERROR 22003: Out of range value for column 'col1' at row 1
511
INSERT INTO t1 (col1) VALUES('8388608');
512
ERROR 22003: Out of range value for column 'col1' at row 1
513
INSERT INTO t1 (col2) VALUES('-1');
514
ERROR 22003: Out of range value for column 'col2' at row 1
515
INSERT INTO t1 (col2) VALUES('16777216');
516
ERROR 22003: Out of range value for column 'col2' at row 1
517
INSERT INTO t1 (col1) VALUES(-8388609.0);
518
ERROR 22003: Out of range value for column 'col1' at row 1
519
INSERT INTO t1 (col1) VALUES(8388608.0);
520
ERROR 22003: Out of range value for column 'col1' at row 1
521
INSERT INTO t1 (col2) VALUES(-1.0);
522
ERROR 22003: Out of range value for column 'col2' at row 1
523
INSERT INTO t1 (col2) VALUES(16777216.0);
524
ERROR 22003: Out of range value for column 'col2' at row 1
525
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
526
ERROR 22003: Out of range value for column 'col1' at row 1
527
UPDATE t1 SET col2 = col2 + 50 WHERE col2 > 0;
528
ERROR 22003: Out of range value for column 'col2' at row 3
529
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
530
ERROR 22012: Division by 0
531
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
532
ERROR 22012: Division by 0
533
INSERT INTO t1 (col1) VALUES ('');
534
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
535
INSERT INTO t1 (col1) VALUES ('a59b');
536
ERROR HY000: Incorrect integer value: 'a59b' for column 'col1' at row 1
537
INSERT INTO t1 (col1) VALUES ('1a');
538
ERROR 01000: Data truncated for column 'col1' at row 1
539
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
541
Warning 1265 Data truncated for column 'col1' at row 1
542
INSERT IGNORE INTO t1 values (1/0,1/0);
544
Error 1365 Division by 0
545
Error 1365 Division by 0
546
INSERT IGNORE INTO t1 VALUES(-8388609,-1),(8388608,16777216);
548
Warning 1264 Out of range value for column 'col1' at row 1
549
Warning 1264 Out of range value for column 'col2' at row 1
550
Warning 1264 Out of range value for column 'col1' at row 2
551
Warning 1264 Out of range value for column 'col2' at row 2
552
INSERT IGNORE INTO t1 VALUES('-8388609','-1'),('8388608','16777216');
554
Warning 1264 Out of range value for column 'col1' at row 1
555
Warning 1264 Out of range value for column 'col2' at row 1
556
Warning 1264 Out of range value for column 'col1' at row 2
557
Warning 1264 Out of range value for column 'col2' at row 2
558
INSERT IGNORE INTO t1 VALUES(-8388609.0,-1.0),(8388608.0,16777216.0);
560
Warning 1264 Out of range value for column 'col1' at row 1
561
Warning 1264 Out of range value for column 'col2' at row 1
562
Warning 1264 Out of range value for column 'col1' at row 2
563
Warning 1264 Out of range value for column 'col2' at row 2
564
UPDATE IGNORE t1 SET col2=1/NULL where col1=0;
583
CREATE TABLE t1 (col1 INT, col2 INT UNSIGNED);
584
INSERT INTO t1 VALUES(-2147483648,0),(0,0),(2147483647,4294967295),('-2147483648','0'),('2147483647','4294967295'),(-2147483648.0,0.0),(2147483647.0,4294967295.0);
1
DROP TABLE IF EXISTS t1;
2
CREATE TABLE t1 (col1 INT);
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);
585
10
INSERT INTO t1 (col1) VALUES(-2147483649);
586
11
ERROR 22003: Out of range value for column 'col1' at row 1
587
12
INSERT INTO t1 (col1) VALUES(2147643648);
588
13
ERROR 22003: Out of range value for column 'col1' at row 1
589
INSERT INTO t1 (col2) VALUES(-1);
590
ERROR 22003: Out of range value for column 'col2' at row 1
591
INSERT INTO t1 (col2) VALUES(4294967296);
592
ERROR 22003: Out of range value for column 'col2' at row 1
593
14
INSERT INTO t1 (col1) VALUES('-2147483649');
594
15
ERROR 22003: Out of range value for column 'col1' at row 1
595
16
INSERT INTO t1 (col1) VALUES('2147643648');
596
17
ERROR 22003: Out of range value for column 'col1' at row 1
597
INSERT INTO t1 (col2) VALUES('-1');
598
ERROR 22003: Out of range value for column 'col2' at row 1
599
INSERT INTO t1 (col2) VALUES('4294967296');
600
ERROR 22003: Out of range value for column 'col2' at row 1
601
18
INSERT INTO t1 (col1) VALUES(-2147483649.0);
602
19
ERROR 22003: Out of range value for column 'col1' at row 1
603
20
INSERT INTO t1 (col1) VALUES(2147643648.0);
604
21
ERROR 22003: Out of range value for column 'col1' at row 1
605
INSERT INTO t1 (col2) VALUES(-1.0);
606
ERROR 22003: Out of range value for column 'col2' at row 1
607
INSERT INTO t1 (col2) VALUES(4294967296.0);
608
ERROR 22003: Out of range value for column 'col2' at row 1
609
22
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
610
23
ERROR 22003: Out of range value for column 'col1' at row 1
611
UPDATE t1 SET col2 =col2 + 50 WHERE col2 > 0;
612
ERROR 22003: Out of range value for column 'col2' at row 3
613
24
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
614
25
ERROR 22012: Division by 0
615
26
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
791
195
ERROR HY000: Incorrect decimal value: '1a' for column 'col1' at row 1
792
196
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
794
Note 1265 Data truncated for column 'col1' at row 1
198
Warning 1265 Data truncated for column 'col1' at row 1
795
199
INSERT IGNORE INTO t1 values (1/0);
797
201
Error 1365 Division by 0
798
INSERT IGNORE INTO t1 VALUES(1000),(-1000);
800
Warning 1264 Out of range value for column 'col1' at row 1
801
Warning 1264 Out of range value for column 'col1' at row 2
802
INSERT IGNORE INTO t1 VALUES('1000'),('-1000');
804
Warning 1264 Out of range value for column 'col1' at row 1
805
Warning 1264 Out of range value for column 'col1' at row 2
806
INSERT IGNORE INTO t1 VALUES(1000.0),(-1000.0);
808
Warning 1264 Out of range value for column 'col1' at row 1
809
Warning 1264 Out of range value for column 'col1' at row 2
202
INSERT IGNORE INTO t1 VALUES (1000);
204
Warning 1264 Out of range value for column 'col1' at row 1
205
INSERT IGNORE INTO t1 VALUES (-1000);
207
Warning 1264 Out of range value for column 'col1' at row 1
208
INSERT IGNORE INTO t1 VALUES ('1000');
210
Warning 1264 Out of range value for column 'col1' at row 1
211
INSERT IGNORE INTO t1 VALUES ('-1000');
213
Warning 1264 Out of range value for column 'col1' at row 1
214
INSERT IGNORE INTO t1 VALUES (1000.0);
216
Warning 1264 Out of range value for column 'col1' at row 1
217
INSERT IGNORE INTO t1 VALUES (-1000.0);
219
Warning 1264 Out of range value for column 'col1' at row 1
810
220
UPDATE IGNORE t1 SET col1=1/NULL where col1=0;
811
221
SELECT * FROM t1;
835
CREATE TABLE t1 (col1 FLOAT, col2 FLOAT UNSIGNED);
836
INSERT INTO t1 VALUES (-1.1E-37,0),(+3.4E+38,+3.4E+38);
837
INSERT INTO t1 VALUES ('-1.1E-37',0),('+3.4E+38','+3.4E+38');
838
INSERT INTO t1 (col1) VALUES (3E-46);
839
INSERT INTO t1 (col1) VALUES (+3.4E+39);
840
ERROR 22003: Out of range value for column 'col1' at row 1
841
INSERT INTO t1 (col2) VALUES (-1.1E-3);
842
ERROR 22003: Out of range value for column 'col2' at row 1
843
INSERT INTO t1 (col1) VALUES ('+3.4E+39');
844
ERROR 22003: Out of range value for column 'col1' at row 1
845
INSERT INTO t1 (col2) VALUES ('-1.1E-3');
846
ERROR 22003: Out of range value for column 'col2' at row 1
847
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
848
ERROR 22003: Out of range value for column 'col1' at row 2
849
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
850
ERROR 22012: Division by 0
851
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
852
ERROR 22012: Division by 0
853
INSERT INTO t1 (col1) VALUES ('');
854
ERROR 01000: Data truncated for column 'col1' at row 1
855
INSERT INTO t1 (col1) VALUES ('a59b');
856
ERROR 01000: Data truncated for column 'col1' at row 1
857
INSERT INTO t1 (col1) VALUES ('1a');
858
ERROR 01000: Data truncated for column 'col1' at row 1
859
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
861
Warning 1265 Data truncated for column 'col1' at row 1
862
INSERT IGNORE INTO t1 (col1) VALUES (1/0);
864
Error 1365 Division by 0
865
INSERT IGNORE INTO t1 VALUES (+3.4E+39,-3.4E+39);
867
Warning 1264 Out of range value for column 'col1' at row 1
868
Warning 1264 Out of range value for column 'col2' at row 1
869
INSERT IGNORE INTO t1 VALUES ('+3.4E+39','-3.4E+39');
871
Warning 1264 Out of range value for column 'col1' at row 1
872
Warning 1264 Out of range value for column 'col2' at row 1
885
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED);
886
INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308);
887
INSERT INTO t1 VALUES ('-2.2E-307',0),('-2E-307',0),('+1.7E+308','+1.7E+308');
888
INSERT INTO t1 (col1) VALUES (-2.2E-330);
889
INSERT INTO t1 (col1) VALUES (+1.7E+309);
890
Got one of the listed errors
891
INSERT INTO t1 (col2) VALUES (-1.1E-3);
892
ERROR 22003: Out of range value for column 'col2' at row 1
893
INSERT INTO t1 (col1) VALUES ('+1.8E+309');
894
ERROR 22003: Out of range value for column 'col1' at row 1
895
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
896
ERROR 22003: Out of range value for column 'col2' at row 1
897
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
898
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
899
ERROR 22012: Division by 0
900
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
901
ERROR 22012: Division by 0
902
INSERT INTO t1 (col1) VALUES ('');
903
ERROR 01000: Data truncated for column 'col1' at row 1
904
INSERT INTO t1 (col1) VALUES ('a59b');
905
ERROR 01000: Data truncated for column 'col1' at row 1
906
INSERT INTO t1 (col1) VALUES ('1a');
907
ERROR 01000: Data truncated for column 'col1' at row 1
908
INSERT IGNORE INTO t1 (col1) VALUES ('2a');
910
Warning 1265 Data truncated for column 'col1' at row 1
911
INSERT IGNORE INTO t1 (col1) values (1/0);
913
Error 1365 Division by 0
914
INSERT IGNORE INTO t1 VALUES (+1.9E+309,-1.9E+309);
915
ERROR 22007: Illegal double '1.9E+309' value found during parsing
916
INSERT IGNORE INTO t1 VALUES ('+2.0E+309','-2.0E+309');
918
Warning 1264 Out of range value for column 'col1' at row 1
919
Warning 1264 Out of range value for column 'col2' at row 1
920
Warning 1264 Out of range value for column 'col2' at row 1
932
1.7976931348623157e308 0
934
241
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
935
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
242
INSERT INTO t1 VALUES ('hello', 'hello');
243
INSERT INTO t1 VALUES ('he', 'he');
244
INSERT INTO t1 VALUES ('hello ', 'hello ');
937
Note 1265 Data truncated for column 'col1' at row 3
246
Note 1265 Data truncated for column 'col1' at row 1
938
247
INSERT INTO t1 (col1) VALUES ('hellobob');
939
248
ERROR 22001: Data too long for column 'col1' at row 1
940
249
INSERT INTO t1 (col2) VALUES ('hellobob');
1117
369
ERROR 22007: Truncated incorrect CHAR(3) value: '1000'
1118
370
insert into t1 (col1) values (cast(1000.0 as char(3)));
1119
371
ERROR 22007: Truncated incorrect CHAR(3) value: '1000.0'
1120
insert into t1 (col2) values (cast('abc' as signed integer));
1121
ERROR 22007: Truncated incorrect INTEGER value: 'abc'
372
insert into t1 (col2) values (cast('abc' as DECIMAL));
373
ERROR 22007: Truncated incorrect DECIMAL value: 'abc'
1122
374
insert into t1 (col2) values (10E+0 + 'a');
1123
375
ERROR 22007: Truncated incorrect DOUBLE value: 'a'
1124
insert into t1 (col2) values (cast('10a' as unsigned integer));
1125
ERROR 22007: Truncated incorrect INTEGER value: '10a'
1126
insert into t1 (col2) values (cast('10' as unsigned integer));
1127
insert into t1 (col2) values (cast('10' as signed integer));
376
insert into t1 (col2) values ('10a');
377
ERROR 01000: Data truncated for column 'col2' at row 1
378
insert into t1 (col2) values (cast('10a' as DECIMAL));
379
insert into t1 (col2) values (cast('10' as DECIMAL));
380
insert into t1 (col2) values (cast('10' as DECIMAL));
1128
381
insert into t1 (col2) values (10E+0 + '0 ');
1129
382
select * from t1;
1135
create table t1 (col1 date, col2 datetime, col3 timestamp);
1136
insert into t1 values (0,0,0);
1137
ERROR 22007: Incorrect date value: '0' for column 'col1' at row 1
1138
insert into t1 values (0.0,0.0,0.0);
1139
ERROR 22007: Incorrect date value: '0' for column 'col1' at row 1
1140
insert into t1 (col1) values (convert('0000-00-00',date));
1141
ERROR 22007: Incorrect datetime value: '0000-00-00'
1142
insert into t1 (col1) values (cast('0000-00-00' as date));
1143
ERROR 22007: Incorrect datetime value: '0000-00-00'
1144
set sql_mode='no_zero_date';
1145
insert into t1 values (0,0,0);
1147
Warning 1264 Out of range value for column 'col1' at row 1
1148
Warning 1264 Out of range value for column 'col2' at row 1
1149
Warning 1265 Data truncated for column 'col3' at row 1
1150
insert into t1 values (0.0,0.0,0.0);
1152
Warning 1264 Out of range value for column 'col1' at row 1
1153
Warning 1264 Out of range value for column 'col2' at row 1
1154
Warning 1265 Data truncated for column 'col3' at row 1
1156
set sql_mode='traditional';
1157
create table t1 (col1 date);
1158
insert ignore into t1 values ('0000-00-00');
1160
Warning 1265 Data truncated for column 'col1' at row 1
1161
insert into t1 select * from t1;
1162
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
1163
insert ignore into t1 values ('0000-00-00');
1165
Warning 1265 Data truncated for column 'col1' at row 1
1166
insert ignore into t1 (col1) values (cast('0000-00-00' as date));
1168
Warning 1292 Incorrect datetime value: '0000-00-00'
1169
insert into t1 select * from t1;
1170
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
1171
alter table t1 modify col1 datetime;
1172
ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col1' at row 1
1173
alter ignore table t1 modify col1 datetime;
1175
Warning 1264 Out of range value for column 'col1' at row 1
1176
Warning 1264 Out of range value for column 'col1' at row 2
1177
insert into t1 select * from t1;
1178
ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'col1' at row 1
1185
create table t1 (col1 tinyint);
1186
drop procedure if exists t1;
1188
Note 1305 PROCEDURE t1 does not exist
1189
create procedure t1 () begin declare exit handler for sqlexception
1190
select'a'; insert into t1 values (200); end;|
1198
set sql_mode=@org_mode;
1199
SET @@sql_mode = 'traditional';
1200
CREATE TABLE t1 (i int not null);
1201
INSERT INTO t1 VALUES ();
1202
ERROR HY000: Field 'i' doesn't have a default value
1203
INSERT INTO t1 VALUES (DEFAULT);
1204
ERROR HY000: Field 'i' doesn't have a default value
1205
INSERT INTO t1 VALUES (DEFAULT(i));
1206
ERROR HY000: Field 'i' doesn't have a default value
1207
ALTER TABLE t1 ADD j int;
1208
INSERT INTO t1 SET j = 1;
1209
ERROR HY000: Field 'i' doesn't have a default value
1210
INSERT INTO t1 SET j = 1, i = DEFAULT;
1211
ERROR HY000: Field 'i' doesn't have a default value
1212
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
1213
ERROR HY000: Field 'i' doesn't have a default value
1214
INSERT INTO t1 VALUES (DEFAULT,1);
1215
ERROR HY000: Field 'i' doesn't have a default value
1217
SET @@sql_mode = '';
1218
CREATE TABLE t1 (i int not null);
1219
INSERT INTO t1 VALUES ();
1221
Warning 1364 Field 'i' doesn't have a default value
1222
INSERT INTO t1 VALUES (DEFAULT);
1224
Warning 1364 Field 'i' doesn't have a default value
1225
INSERT INTO t1 VALUES (DEFAULT(i));
1226
ERROR HY000: Field 'i' doesn't have a default value
1227
ALTER TABLE t1 ADD j int;
1228
INSERT INTO t1 SET j = 1;
1230
Warning 1364 Field 'i' doesn't have a default value
1231
INSERT INTO t1 SET j = 1, i = DEFAULT;
1233
Warning 1364 Field 'i' doesn't have a default value
1234
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
1235
ERROR HY000: Field 'i' doesn't have a default value
1236
INSERT INTO t1 VALUES (DEFAULT,1);
1238
Warning 1364 Field 'i' doesn't have a default value
1240
set @@sql_mode='traditional';
389
CREATE TABLE t1 (i int not null);
390
INSERT INTO t1 VALUES ();
391
ERROR HY000: Field 'i' doesn't have a default value
392
INSERT INTO t1 VALUES (DEFAULT);
393
ERROR HY000: Field 'i' doesn't have a default value
394
INSERT INTO t1 VALUES (DEFAULT(i));
395
ERROR HY000: Field 'i' doesn't have a default value
396
ALTER TABLE t1 ADD j int;
397
INSERT INTO t1 SET j = 1;
398
ERROR HY000: Field 'i' doesn't have a default value
399
INSERT INTO t1 SET j = 1, i = DEFAULT;
400
ERROR HY000: Field 'i' doesn't have a default value
401
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
402
ERROR HY000: Field 'i' doesn't have a default value
403
INSERT INTO t1 VALUES (DEFAULT,1);
404
ERROR HY000: Field 'i' doesn't have a default value
406
CREATE TABLE t1 (i int not null);
407
INSERT INTO t1 VALUES ();
408
ERROR HY000: Field 'i' doesn't have a default value
409
INSERT INTO t1 VALUES (DEFAULT);
410
ERROR HY000: Field 'i' doesn't have a default value
411
INSERT INTO t1 VALUES (DEFAULT(i));
412
ERROR HY000: Field 'i' doesn't have a default value
413
ALTER TABLE t1 ADD j int;
414
INSERT INTO t1 SET j = 1;
415
ERROR HY000: Field 'i' doesn't have a default value
416
INSERT INTO t1 SET j = 1, i = DEFAULT;
417
ERROR HY000: Field 'i' doesn't have a default value
418
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
419
ERROR HY000: Field 'i' doesn't have a default value
420
INSERT INTO t1 VALUES (DEFAULT,1);
421
ERROR HY000: Field 'i' doesn't have a default value
1241
423
create table t1(a varchar(65537));
1242
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
424
ERROR 42000: Column length too big for column 'a' (max = 16383); use BLOB or TEXT instead
1243
425
create table t1(a varbinary(65537));
1244
426
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
1245
set @@sql_mode='traditional';
1246
427
create table t1(a int, b date not null);
1247
alter table t1 modify a bigint unsigned not null;
428
alter table t1 modify a bigint not null;
1248
429
show create table t1;
1249
430
Table Create Table
1250
431
t1 CREATE TABLE `t1` (
1251
`a` bigint(20) unsigned NOT NULL,
1252
433
`b` date NOT NULL
1253
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1255
set @@sql_mode='traditional';
1256
create table t1 (d date);
1257
insert into t1 values ('2000-10-00');
1258
ERROR 22007: Incorrect date value: '2000-10-00' for column 'd' at row 1
1259
insert into t1 values (1000);
1260
ERROR 22007: Incorrect date value: '1000' for column 'd' at row 1
1261
insert into t1 values ('2000-10-01');
1262
update t1 set d = 1100;
1263
ERROR 22007: Incorrect date value: '1100' for column 'd' at row 1
1268
set @@sql_mode='traditional';
1269
436
create table t1(a int, b timestamp);
1270
437
alter table t1 add primary key(a);
1271
438
show create table t1;
1272
439
Table Create Table
1273
440
t1 CREATE TABLE `t1` (
1274
`a` int(11) NOT NULL DEFAULT '0',
1275
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
442
`b` timestamp NULL DEFAULT NULL,
1276
443
PRIMARY KEY (`a`)
1277
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1279
446
create table t1(a int, b timestamp default 20050102030405);
1280
447
alter table t1 add primary key(a);
1281
448
show create table t1;
1282
449
Table Create Table
1283
450
t1 CREATE TABLE `t1` (
1284
`a` int(11) NOT NULL DEFAULT '0',
1285
`b` timestamp NOT NULL DEFAULT '2005-01-02 03:04:05',
452
`b` timestamp NULL DEFAULT '2005-01-02 03:04:05',
1286
453
PRIMARY KEY (`a`)
1287
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1289
set @@sql_mode='traditional';
1290
create table t1(a bit(2));
1291
insert into t1 values(b'101');
1292
ERROR 22001: Data too long for column 'a' at row 1
1296
set sql_mode='traditional';
1297
456
create table t1 (date date not null);
1298
457
create table t2 select date from t1;
1299
458
show create table t2;
1300
459
Table Create Table
1301
460
t2 CREATE TABLE `t2` (
1302
461
`date` date NOT NULL
1303
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1304
463
drop table t2,t1;
1305
set @@sql_mode= @org_mode;
1307
464
create table t1 (i int)
1308
465
comment '123456789*123456789*123456789*123456789*123456789*123456789*';
1309
466
show create table t1;
1310
467
Table Create Table
1311
468
t1 CREATE TABLE `t1` (
1312
`i` int(11) DEFAULT NULL
1313
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
470
) ENGINE=DEFAULT COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
1315
set sql_mode= 'traditional';
1316
create table t1(col1 tinyint, col2 tinyint unsigned,
1317
col3 smallint, col4 smallint unsigned,
1318
col5 mediumint, col6 mediumint unsigned,
1319
col7 int, col8 int unsigned,
1320
col9 bigint, col10 bigint unsigned);
472
create table t1(col1 int, col2 int,
475
col9 bigint, col10 bigint);
1321
476
insert into t1(col1) values('-');
1322
477
ERROR HY000: Incorrect integer value: '-' for column 'col1' at row 1
1323
478
insert into t1(col2) values('+');