179
179
show create table t1;
180
180
Table Create Table
181
181
t1 CREATE TABLE `t1` (
182
`da` date DEFAULT '1962-03-03',
183
`dt` datetime DEFAULT '1962-03-03 00:00:00'
182
`da` DATE DEFAULT '1962-03-03',
183
`dt` DATETIME DEFAULT '1962-03-03 00:00:00'
184
) ENGINE=DEFAULT COLLATE = utf8_general_ci
185
185
insert into t1 values ();
186
186
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
187
187
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
268
268
select f1,f2,f3 from t1,t2,t3 where (f1,'1') in ((f2,'1'),(f3,'1'));
270
270
2001-01-01 2001-01-01 00:00:00 2001-01-01 00:00:00
271
2001-01-01 2001-01-01 00:00:00 2001-02-03 12:34:56
272
2001-01-01 2001-01-01 00:00:00 2002-04-06 11:22:33
271
273
2001-01-01 2001-02-03 12:34:56 2001-01-01 00:00:00
272
274
2001-01-01 2002-04-06 11:22:33 2001-01-01 00:00:00
273
2001-01-01 2001-01-01 00:00:00 2001-02-03 12:34:56
274
2001-01-01 2001-01-01 00:00:00 2002-04-06 11:22:33
275
275
select f1 from t1 where ('1',f1) in (('1','01-01-01'),('1','2001-1-1 0:0:0'),('1','02-02-02'));
342
342
create table t2 as select coalesce(f1,f1) as f4 from t1;
344
344
Field Type Null Default Default_is_NULL On_Update
346
346
create table t3 as select coalesce(f1,f2) as f4 from t1;
348
348
Field Type Null Default Default_is_NULL On_Update
349
f4 DATETIME TRUE TRUE
350
350
create table t4 as select coalesce(f2,f2) as f4 from t1;
352
352
Field Type Null Default Default_is_NULL On_Update
353
f4 DATETIME TRUE TRUE
354
354
create table t5 as select coalesce(f1,f3) as f4 from t1;
356
356
Field Type Null Default Default_is_NULL On_Update
358
358
create table t6 as select coalesce(f2,f3) as f4 from t1;
360
360
Field Type Null Default Default_is_NULL On_Update
362
362
create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1;
364
364
Field Type Null Default Default_is_NULL On_Update
365
f4 DATETIME TRUE TRUE
366
366
create table t8 as select coalesce(cast('01-01-01' as datetime),f2) as f4
369
369
Field Type Null Default Default_is_NULL On_Update
370
f4 DATETIME TRUE TRUE
371
371
create table t9 as select case when 1 then cast('01-01-01' as date)
372
372
when 0 then cast('01-01-01' as date) end as f4 from t1;
374
374
Field Type Null Default Default_is_NULL On_Update
376
376
create table t10 as select case when 1 then cast('01-01-01' as datetime)
377
377
when 0 then cast('01-01-01' as datetime) end as f4 from t1;
379
379
Field Type Null Default Default_is_NULL On_Update
380
f4 DATETIME TRUE TRUE
381
381
create table t11 as select if(1, cast('01-01-01' as datetime),
382
382
cast('01-01-01' as date)) as f4 from t1;
384
384
Field Type Null Default Default_is_NULL On_Update
386
386
create table t12 as select least(cast('01-01-01' as datetime),
387
387
cast('01-01-01' as date)) as f4 from t1;
389
389
Field Type Null Default Default_is_NULL On_Update
391
391
create table t13 as select ifnull(cast('01-01-01' as datetime),
392
392
cast('01-01-01' as date)) as f4 from t1;
394
394
Field Type Null Default Default_is_NULL On_Update
396
396
drop tables t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13;
397
397
###################################################################
398
398
create table t1 (a int);
449
449
show create table t1;
450
450
Table Create Table
451
451
t1 CREATE TABLE `t1` (
452
`da` date DEFAULT '1962-03-03',
453
`dt` datetime DEFAULT '1962-03-03 00:00:00'
452
`da` DATE DEFAULT '1962-03-03',
453
`dt` DATETIME DEFAULT '1962-03-03 00:00:00'
454
) ENGINE=DEFAULT COLLATE = utf8_general_ci
455
455
insert into t1 values ();
456
456
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
457
457
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');