1
drop table if exists t1;
2
create table t1 (t datetime);
3
insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000);
20
delete from t1 where t > 0;
22
Table Op Msg_type Msg_text
23
test.t1 optimize status OK
25
Table Op Msg_type Msg_text
26
test.t1 check status OK
28
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
29
insert into t1 values ("2003-003-03");
30
insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01");
53
insert into t1 values("2003-0303 12:13:14");
55
Warning 1264 Out of range value for column 't' at row 1
60
CREATE TABLE t1 (a timestamp, b date, c time, d datetime);
61
insert into t1 (b,c,d) values(now(),curtime(),now());
63
Note 1265 Data truncated for column 'b' at row 1
64
select date_format(a,"%Y-%m-%d")=b,right(a+0,6)=c+0,a=d+0 from t1;
65
date_format(a,"%Y-%m-%d")=b right(a+0,6)=c+0 a=d+0
68
CREATE TABLE t1 (a datetime not null);
69
insert into t1 values (0);
70
select * from t1 where a is null;
74
create table t1 (id int, dt datetime);
75
insert into t1 values (1,"2001-08-14 00:00:00"),(2,"2001-08-15 00:00:00"),(3,"2001-08-16 00:00:00"),(4,"2003-09-15 01:20:30");
76
select * from t1 where dt='2001-08-14 00:00:00' and dt = if(id=1,'2001-08-14 00:00:00','1999-08-15');
79
create index dt on t1 (dt);
80
select * from t1 where dt > 20021020;
83
select * from t1 ignore index (dt) where dt > 20021020;
88
`date` datetime NOT NULL default '0000-00-00 00:00:00',
89
`numfacture` int(6) unsigned NOT NULL default '0',
90
`expedition` datetime NOT NULL default '0000-00-00 00:00:00',
91
PRIMARY KEY (`numfacture`),
93
KEY `expedition` (`expedition`)
95
INSERT INTO t1 (expedition) VALUES ('0001-00-00 00:00:00');
96
SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
97
date numfacture expedition
98
0000-00-00 00:00:00 0 0001-00-00 00:00:00
99
INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00');
100
SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
101
date numfacture expedition
102
0000-00-00 00:00:00 0 0001-00-00 00:00:00
103
0000-00-00 00:00:00 1212 0001-00-00 00:00:00
104
EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
105
id select_type table type possible_keys key key_len ref rows Extra
106
1 SIMPLE t1 ref expedition expedition 8 const 1
108
create table t1 (a datetime not null, b datetime not null);
109
insert into t1 values (now(), now());
110
insert into t1 values (now(), now());
111
select * from t1 where a is null or b is null;
114
create table t1 (t datetime);
115
insert into t1 values (20030102030460),(20030102036301),(20030102240401),
116
(20030132030401),(20031302030401),(100001202030401);
118
Warning 1264 Out of range value for column 't' at row 1
119
Warning 1264 Out of range value for column 't' at row 2
120
Warning 1264 Out of range value for column 't' at row 3
121
Warning 1264 Out of range value for column 't' at row 4
122
Warning 1264 Out of range value for column 't' at row 5
123
Warning 1264 Out of range value for column 't' at row 6
133
insert into t1 values
134
("2003-01-02 03:04:60"),("2003-01-02 03:63:01"),("2003-01-02 24:04:01"),
135
("2003-01-32 03:04:01"),("2003-13-02 03:04:01"), ("10000-12-02 03:04:00");
137
Warning 1264 Out of range value for column 't' at row 1
138
Warning 1264 Out of range value for column 't' at row 2
139
Warning 1264 Out of range value for column 't' at row 3
140
Warning 1264 Out of range value for column 't' at row 4
141
Warning 1264 Out of range value for column 't' at row 5
142
Warning 1264 Out of range value for column 't' at row 6
152
insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer");
154
Warning 1264 Out of range value for column 't' at row 1
155
Warning 1264 Out of range value for column 't' at row 2
156
select * from t1 order by t;
161
create table t1 (dt datetime);
162
insert into t1 values ("12-00-00"), ("00-00-00 01:00:00");
163
insert into t1 values ("00-00-00"), ("00-00-00 00:00:00");
171
select cast('2006-12-05 22:10:10' as datetime) + 0;
172
cast('2006-12-05 22:10:10' as datetime) + 0
173
20061205221010.000000
174
CREATE TABLE t1(a DATETIME NOT NULL);
175
INSERT INTO t1 VALUES ('20060606155555');
176
SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555");
179
PREPARE s FROM 'SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555")';
185
SELECT CAST(CAST('2006-08-10' AS DATE) AS DECIMAL(20,6));
186
CAST(CAST('2006-08-10' AS DATE) AS DECIMAL(20,6))
188
SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6));
189
CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6))
190
20060810101112.000000
191
SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6));
192
CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6))
193
20060810101112.000014
194
SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6));
195
CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6))
197
set @org_mode=@@sql_mode;
198
create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
200
Note 1265 Data truncated for column 'da' at row 1
201
show create table t1;
203
t1 CREATE TABLE `t1` (
204
`da` date DEFAULT '1962-03-03',
205
`dt` datetime DEFAULT '1962-03-03 00:00:00'
206
) ENGINE=MyISAM DEFAULT CHARSET=latin1
207
insert into t1 values ();
208
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
210
Note 1265 Data truncated for column 'da' at row 1
211
set @@sql_mode='ansi,traditional';
212
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
214
Note 1265 Data truncated for column 'da' at row 1
215
insert into t1 set dt='2007-03-23 13:49:38',da=dt;
217
Note 1265 Data truncated for column 'da' at row 1
218
insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
219
ERROR 22007: Incorrect date value: '2007-03-32' for column 'da' at row 1
222
1962-03-03 1962-03-03 00:00:00
223
2007-03-23 2007-03-23 13:49:38
224
2007-03-23 2007-03-23 13:49:38
225
2007-03-23 2007-03-23 13:49:38
227
create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
228
ERROR 42000: Invalid default value for 'da'
229
create table t1 (t time default '916:00:00 a');
230
ERROR 42000: Invalid default value for 't'
231
set @@sql_mode= @org_mode;
232
create table t1 (f1 date, f2 datetime, f3 timestamp);
233
insert into t1(f1) values(curdate());
234
select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
235
curdate() < now() f1 < now() cast(f1 as date) < now()
238
insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
239
insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
240
insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
241
insert into t1 values('2001-04-15','2001-04-15 00:00:00','2001-04-15 00:00:00');
242
insert into t1 values('2001-05-20','2001-05-20 01:01:01','2001-05-20 01:01:01');
243
select f1, f3 from t1 where f1 >= '2001-02-05 00:00:00' and f3 <= '2001-04-15';
245
2001-02-05 2001-02-05 01:01:01
246
2001-03-10 2001-03-10 01:01:01
247
2001-04-15 2001-04-15 00:00:00
248
select f1, f3 from t1 where f1 >= '2001-2-5 0:0:0' and f2 <= '2001-4-15';
250
2001-02-05 2001-02-05 01:01:01
251
2001-03-10 2001-03-10 01:01:01
252
2001-04-15 2001-04-15 00:00:00
253
select f1, f2 from t1 where if(1, f1, 0) >= f2;
255
2001-02-05 2001-02-05 00:00:00
256
2001-03-10 2001-03-09 01:01:01
257
2001-04-15 2001-04-15 00:00:00
258
select 1 from dual where cast('2001-1-1 2:3:4' as date) = cast('2001-01-01' as datetime);
261
select f1, f2, f1 > f2, f1 = f2, f1 < f2 from t1;
262
f1 f2 f1 > f2 f1 = f2 f1 < f2
263
2001-01-01 2001-01-01 01:01:01 0 0 1
264
2001-02-05 2001-02-05 00:00:00 0 1 0
265
2001-03-10 2001-03-09 01:01:01 1 0 0
266
2001-04-15 2001-04-15 00:00:00 0 1 0
267
2001-05-20 2001-05-20 01:01:01 0 0 1
269
create table t1 (f1 date, f2 datetime, f3 timestamp);
270
insert into t1 values('2001-01-01','2001-01-01 01:01:01','2001-01-01 01:01:01');
271
insert into t1 values('2001-02-05','2001-02-05 00:00:00','2001-02-05 01:01:01');
272
insert into t1 values('2001-03-10','2001-03-09 01:01:01','2001-03-10 01:01:01');
273
insert into t1 values('2001-04-15','2001-04-15 00:00:00','2001-04-15 00:00:00');
274
insert into t1 values('2001-05-20','2001-05-20 01:01:01','2001-05-20 01:01:01');
275
select f2 from t1 where f2 between '2001-2-5' and '01-04-14';
279
select f1, f2, f3 from t1 where f1 between f2 and f3;
281
2001-02-05 2001-02-05 00:00:00 2001-02-05 01:01:01
282
2001-03-10 2001-03-09 01:01:01 2001-03-10 01:01:01
283
2001-04-15 2001-04-15 00:00:00 2001-04-15 00:00:00
284
select f1, f2, f3 from t1 where cast(f1 as datetime) between f2 and
287
2001-02-05 2001-02-05 00:00:00 2001-02-05 01:01:01
288
2001-03-10 2001-03-09 01:01:01 2001-03-10 01:01:01
289
2001-04-15 2001-04-15 00:00:00 2001-04-15 00:00:00
290
select f2 from t1 where '2001-04-10 12:34:56' between f2 and '01-05-01';
295
select f2, f3 from t1 where '01-03-10' between f2 and f3;
297
2001-03-09 01:01:01 2001-03-10 01:01:01
298
select f2 from t1 where DATE(f2) between "2001-4-15" AND "01-4-15";
301
SELECT 1 from dual where NOW() BETWEEN CURRENT_DATE() - INTERVAL 1 DAY AND CURRENT_DATE();
304
create table t1 (f1 date);
305
insert into t1 values('01-01-01'),('01-01-02'),('01-01-03');
306
select * from t1 where f1 in ('01-01-01','2001-01-02','2001-01-03 00:00:00');
311
create table t2(f2 datetime);
312
insert into t2 values('01-01-01 00:00:00'),('01-02-03 12:34:56'),('02-04-06 11:22:33');
313
select * from t2 where f2 in ('01-01-01','01-02-03 12:34:56','01-02-03');
317
select * from t1,t2 where '01-01-02' in (f1, cast(f2 as date));
319
2001-01-02 2001-01-01 00:00:00
320
2001-01-02 2001-02-03 12:34:56
321
2001-01-02 2002-04-06 11:22:33
322
select * from t1,t2 where '01-01-01' in (f1, '01-02-03');
324
2001-01-01 2001-01-01 00:00:00
325
2001-01-01 2001-02-03 12:34:56
326
2001-01-01 2002-04-06 11:22:33
327
select * from t1,t2 where if(1,'01-02-03 12:34:56','') in (f1, f2);
329
2001-01-01 2001-02-03 12:34:56
330
2001-01-02 2001-02-03 12:34:56
331
2001-01-03 2001-02-03 12:34:56
332
create table t3(f3 varchar(20));
333
insert into t3 select * from t2;
334
select * from t2,t3 where f2 in (f3,'03-04-05');
336
2001-01-01 00:00:00 2001-01-01 00:00:00
337
2001-02-03 12:34:56 2001-02-03 12:34:56
338
2002-04-06 11:22:33 2002-04-06 11:22:33
339
select f1,f2,f3 from t1,t2,t3 where (f1,'1') in ((f2,'1'),(f3,'1'));
341
2001-01-01 2001-01-01 00:00:00 2001-01-01 00:00:00
342
2001-01-01 2001-02-03 12:34:56 2001-01-01 00:00:00
343
2001-01-01 2002-04-06 11:22:33 2001-01-01 00:00:00
344
2001-01-01 2001-01-01 00:00:00 2001-02-03 12:34:56
345
2001-01-01 2001-01-01 00:00:00 2002-04-06 11:22:33
346
select f1 from t1 where ('1',f1) in (('1','01-01-01'),('1','2001-1-1 0:0:0'),('1','02-02-02'));
350
select least(cast('01-01-01' as date), '01-01-02');
351
least(cast('01-01-01' as date), '01-01-02')
353
select greatest(cast('01-01-01' as date), '01-01-02');
354
greatest(cast('01-01-01' as date), '01-01-02')
356
select least(cast('01-01-01' as date), '01-01-02') + 0;
357
least(cast('01-01-01' as date), '01-01-02') + 0
359
select greatest(cast('01-01-01' as date), '01-01-02') + 0;
360
greatest(cast('01-01-01' as date), '01-01-02') + 0
362
select least(cast('01-01-01' as datetime), '01-01-02') + 0;
363
least(cast('01-01-01' as datetime), '01-01-02') + 0
365
select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed);
366
cast(least(cast('01-01-01' as datetime), '01-01-02') as signed)
368
select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(16,2));
369
cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal(16,2))
371
DROP PROCEDURE IF EXISTS test27759 ;
372
CREATE PROCEDURE test27759()
374
declare v_a date default '2007-4-10';
375
declare v_b date default '2007-4-11';
376
declare v_c datetime default '2004-4-9 0:0:0';
377
select v_a as a,v_b as b,
378
least( v_a, v_b ) as a_then_b,
379
least( v_b, v_a ) as b_then_a,
380
least( v_c, v_a ) as c_then_a;
383
a b a_then_b b_then_a c_then_a
384
2007-04-10 2007-04-11 2007-04-10 2007-04-10 2004-04-09 00:00:00
385
drop procedure test27759;
386
create table t1 (f1 date);
387
insert into t1 values (curdate());
388
select left(f1,10) = curdate() from t1;
389
left(f1,10) = curdate()
392
create table t1(f1 date);
393
insert into t1 values('01-01-01'),('02-02-02'),('01-01-01'),('02-02-02');
395
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
396
if(@bug28261 = f1, '', @bug28261:= f1)
402
Warning 1292 Incorrect date value: '' for column 'f1' at row 1
403
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
404
if(@bug28261 = f1, '', @bug28261:= f1)
409
select if(@bug28261 = f1, '', @bug28261:= f1) from t1;
410
if(@bug28261 = f1, '', @bug28261:= f1)
416
create table t1(f1 datetime);
417
insert into t1 values('2001-01-01'),('2002-02-02');
418
select * from t1 where f1 between 20020101 and 20070101000000;
421
select * from t1 where f1 between 2002010 and 20070101000000;
426
Warning 1292 Incorrect datetime value: '2002010' for column 'f1' at row 1
427
select * from t1 where f1 between 20020101 and 2007010100000;
430
Warning 1292 Incorrect datetime value: '2007010100000' for column 'f1' at row 1
433
# Bug#27216: functions with parameters of different date types may
434
# return wrong type of the result.
436
create table t1 (f1 date, f2 datetime, f3 varchar(20));
437
create table t2 as select coalesce(f1,f1) as f4 from t1;
439
Field Type Null Key Default Extra
441
create table t3 as select coalesce(f1,f2) as f4 from t1;
443
Field Type Null Key Default Extra
445
create table t4 as select coalesce(f2,f2) as f4 from t1;
447
Field Type Null Key Default Extra
449
create table t5 as select coalesce(f1,f3) as f4 from t1;
451
Field Type Null Key Default Extra
452
f4 varbinary(20) YES NULL
453
create table t6 as select coalesce(f2,f3) as f4 from t1;
455
Field Type Null Key Default Extra
456
f4 varbinary(20) YES NULL
457
create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1;
459
Field Type Null Key Default Extra
461
create table t8 as select coalesce(cast('01-01-01' as datetime),f2) as f4
464
Field Type Null Key Default Extra
466
create table t9 as select case when 1 then cast('01-01-01' as date)
467
when 0 then cast('01-01-01' as date) end as f4 from t1;
469
Field Type Null Key Default Extra
471
create table t10 as select case when 1 then cast('01-01-01' as datetime)
472
when 0 then cast('01-01-01' as datetime) end as f4 from t1;
474
Field Type Null Key Default Extra
476
create table t11 as select if(1, cast('01-01-01' as datetime),
477
cast('01-01-01' as date)) as f4 from t1;
479
Field Type Null Key Default Extra
481
create table t12 as select least(cast('01-01-01' as datetime),
482
cast('01-01-01' as date)) as f4 from t1;
484
Field Type Null Key Default Extra
486
create table t13 as select ifnull(cast('01-01-01' as datetime),
487
cast('01-01-01' as date)) as f4 from t1;
489
Field Type Null Key Default Extra
491
drop tables t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13;
492
###################################################################
493
create table t1 (f1 time);
494
insert into t1 set f1 = '45:44:44';
495
insert into t1 set f1 = '15:44:44';
496
select * from t1 where (convert(f1,datetime)) != 1;
500
Warning 1292 Incorrect datetime value: '0000-00-00 45:44:44'
502
create table t1 (a tinyint);
503
insert into t1 values (), (), ();
504
select sum(a) from t1 group by convert(a, datetime);
508
create table t1 (id int(10) not null, cur_date datetime not null);
509
create table t2 (id int(10) not null, cur_date date not null);
510
insert into t1 (id, cur_date) values (1, '2007-04-25 18:30:22');
511
insert into t2 (id, cur_date) values (1, '2007-04-25');
512
set @@optimizer_switch=no_semijoin;
515
where id in (select id from t1 as x1 where (t1.cur_date is null));
516
id select_type table type possible_keys key key_len ref rows filtered Extra
517
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
518
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
520
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
521
Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from `test`.`t1` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where 0))
523
where id in (select id from t1 as x1 where (t1.cur_date is null));
527
where id in (select id from t2 as x1 where (t2.cur_date is null));
528
id select_type table type possible_keys key key_len ref rows filtered Extra
529
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
530
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
532
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
533
Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from `test`.`t2` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where 0))
535
where id in (select id from t2 as x1 where (t2.cur_date is null));
537
insert into t1 (id, cur_date) values (2, '2007-04-26 18:30:22');
538
insert into t2 (id, cur_date) values (2, '2007-04-26');
541
where id in (select id from t1 as x1 where (t1.cur_date is null));
542
id select_type table type possible_keys key key_len ref rows filtered Extra
543
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
544
2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where
546
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
547
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`id`,<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where ((`test`.`t1`.`cur_date` = 0) and (<cache>(`test`.`t1`.`id`) = `test`.`x1`.`id`))))
549
where id in (select id from t1 as x1 where (t1.cur_date is null));
553
where id in (select id from t2 as x1 where (t2.cur_date is null));
554
id select_type table type possible_keys key key_len ref rows filtered Extra
555
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
556
2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where
558
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
559
Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`id`,<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where ((`test`.`t2`.`cur_date` = 0) and (<cache>(`test`.`t2`.`id`) = `test`.`x1`.`id`))))
561
where id in (select id from t2 as x1 where (t2.cur_date is null));
563
set @@optimizer_switch='';
566
set @org_mode=@@sql_mode;
567
create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
569
Note 1265 Data truncated for column 'da' at row 1
570
show create table t1;
572
t1 CREATE TABLE `t1` (
573
`da` date DEFAULT '1962-03-03',
574
`dt` datetime DEFAULT '1962-03-03 00:00:00'
575
) ENGINE=MyISAM DEFAULT CHARSET=latin1
576
insert into t1 values ();
577
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
579
Note 1265 Data truncated for column 'da' at row 1
580
set @@sql_mode='ansi,traditional';
581
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
583
Note 1265 Data truncated for column 'da' at row 1
584
insert into t1 set dt='2007-03-23 13:49:38',da=dt;
586
Note 1265 Data truncated for column 'da' at row 1
587
insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
588
ERROR 22007: Incorrect date value: '2007-03-32' for column 'da' at row 1
591
1962-03-03 1962-03-03 00:00:00
592
2007-03-23 2007-03-23 13:49:38
593
2007-03-23 2007-03-23 13:49:38
594
2007-03-23 2007-03-23 13:49:38
596
create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
597
ERROR 42000: Invalid default value for 'da'
598
create table t1 (t time default '916:00:00 a');
599
ERROR 42000: Invalid default value for 't'
600
set @@sql_mode= @org_mode;