~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to tests/r/type_datetime.result

  • Committer: Padraig O'Sullivan
  • Date: 2010-03-15 14:05:26 UTC
  • mfrom: (1237.9.99 staging)
  • Revision ID: osullivan.padraig@gmail.com-20100315140526-opbgwdwn6tfecdkq
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
341
341
create table t1 (f1 date, f2 datetime, f3 varchar(20));
342
342
create table t2 as select coalesce(f1,f1) as f4 from t1;
343
343
desc t2;
344
 
Field   Type    Null    Key     Default Extra
345
 
f4      date    YES             NULL    
 
344
Field   Type    Null    Default Default_is_NULL On_Update
 
345
f4      DATE    TRUE            TRUE    
346
346
create table t3 as select coalesce(f1,f2) as f4 from t1;
347
347
desc t3;
348
 
Field   Type    Null    Key     Default Extra
349
 
f4      datetime        YES             NULL    
 
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;
351
351
desc t4;
352
 
Field   Type    Null    Key     Default Extra
353
 
f4      datetime        YES             NULL    
 
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;
355
355
desc t5;
356
 
Field   Type    Null    Key     Default Extra
357
 
f4      varbinary(80)   YES             NULL    
 
356
Field   Type    Null    Default Default_is_NULL On_Update
 
357
f4      VARCHAR TRUE            TRUE    
358
358
create table t6 as select coalesce(f2,f3) as f4 from t1;
359
359
desc t6;
360
 
Field   Type    Null    Key     Default Extra
361
 
f4      varbinary(80)   YES             NULL    
 
360
Field   Type    Null    Default Default_is_NULL On_Update
 
361
f4      VARCHAR TRUE            TRUE    
362
362
create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1;
363
363
desc t7;
364
 
Field   Type    Null    Key     Default Extra
365
 
f4      datetime        YES             NULL    
 
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
367
367
from t1;
368
368
desc t8;
369
 
Field   Type    Null    Key     Default Extra
370
 
f4      datetime        YES             NULL    
 
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;
373
373
desc t9;
374
 
Field   Type    Null    Key     Default Extra
375
 
f4      date    YES             NULL    
 
374
Field   Type    Null    Default Default_is_NULL On_Update
 
375
f4      DATE    TRUE            TRUE    
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;
378
378
desc t10;
379
 
Field   Type    Null    Key     Default Extra
380
 
f4      datetime        YES             NULL    
 
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;
383
383
desc t11;
384
 
Field   Type    Null    Key     Default Extra
385
 
f4      date    YES             NULL    
 
384
Field   Type    Null    Default Default_is_NULL On_Update
 
385
f4      DATE    TRUE            TRUE    
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;
388
388
desc t12;
389
 
Field   Type    Null    Key     Default Extra
390
 
f4      date    YES             NULL    
 
389
Field   Type    Null    Default Default_is_NULL On_Update
 
390
f4      DATE    TRUE            TRUE    
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;
393
393
desc t13;
394
 
Field   Type    Null    Key     Default Extra
395
 
f4      date    YES             NULL    
 
394
Field   Type    Null    Default Default_is_NULL On_Update
 
395
f4      DATE    TRUE            TRUE    
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);