~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/r/type_datetime.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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'
184
 
) ENGINE=DEFAULT
 
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'));
269
269
f1      f2      f3
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'));
276
276
f1
277
277
2001-01-01
342
342
create table t2 as select coalesce(f1,f1) as f4 from t1;
343
343
desc t2;
344
344
Field   Type    Null    Default Default_is_NULL On_Update
345
 
f4      DATE    TRUE            TRUE    
 
345
f4      DATE    YES             YES     
346
346
create table t3 as select coalesce(f1,f2) as f4 from t1;
347
347
desc t3;
348
348
Field   Type    Null    Default Default_is_NULL On_Update
349
 
f4      DATETIME        TRUE            TRUE    
 
349
f4      DATETIME        YES             YES     
350
350
create table t4 as select coalesce(f2,f2) as f4 from t1;
351
351
desc t4;
352
352
Field   Type    Null    Default Default_is_NULL On_Update
353
 
f4      DATETIME        TRUE            TRUE    
 
353
f4      DATETIME        YES             YES     
354
354
create table t5 as select coalesce(f1,f3) as f4 from t1;
355
355
desc t5;
356
356
Field   Type    Null    Default Default_is_NULL On_Update
357
 
f4      VARCHAR TRUE            TRUE    
 
357
f4      VARBINARY       YES             YES     
358
358
create table t6 as select coalesce(f2,f3) as f4 from t1;
359
359
desc t6;
360
360
Field   Type    Null    Default Default_is_NULL On_Update
361
 
f4      VARCHAR TRUE            TRUE    
 
361
f4      VARBINARY       YES             YES     
362
362
create table t7 as select coalesce(makedate(1997,1),f2) as f4 from t1;
363
363
desc t7;
364
364
Field   Type    Null    Default Default_is_NULL On_Update
365
 
f4      DATETIME        TRUE            TRUE    
 
365
f4      DATETIME        YES             YES     
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
369
Field   Type    Null    Default Default_is_NULL On_Update
370
 
f4      DATETIME        TRUE            TRUE    
 
370
f4      DATETIME        YES             YES     
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
374
Field   Type    Null    Default Default_is_NULL On_Update
375
 
f4      DATE    TRUE            TRUE    
 
375
f4      DATE    YES             YES     
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
379
Field   Type    Null    Default Default_is_NULL On_Update
380
 
f4      DATETIME        TRUE            TRUE    
 
380
f4      DATETIME        YES             YES     
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
384
Field   Type    Null    Default Default_is_NULL On_Update
385
 
f4      DATE    TRUE            TRUE    
 
385
f4      DATE    YES             YES     
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
389
Field   Type    Null    Default Default_is_NULL On_Update
390
 
f4      DATE    TRUE            TRUE    
 
390
f4      DATE    YES             YES     
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
394
Field   Type    Null    Default Default_is_NULL On_Update
395
 
f4      DATE    TRUE            TRUE    
 
395
f4      DATE    YES             YES     
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'
454
 
) ENGINE=DEFAULT
 
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');