~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/create.result

  • Committer: Jay Pipes
  • Date: 2009-02-21 16:00:06 UTC
  • mto: (907.1.1 trunk-with-temporal)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090221160006-vnk3wt4qbcz62eru
Removes the TIME column type and related time functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
Field   Type    Null    Key     Default Extra
114
114
x       varchar(50)     YES             NULL    
115
115
drop table t2;
116
 
create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
 
116
create table t2 select now() as a , curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
117
117
describe t2;
118
118
Field   Type    Null    Key     Default Extra
119
119
a       datetime        YES             NULL    
120
 
b       time    YES             NULL    
121
120
c       date    NO              0000-00-00      
122
121
d       int     NO              0       
123
122
e       decimal(3,1)    NO              0.0     
124
123
f       bigint  NO              0       
125
124
drop table t2;
126
 
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29  20:45:11" AS DATETIME) as dt;
 
125
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("2001-12-29  20:45:11" AS DATETIME) as dt;
127
126
describe t2;
128
127
Field   Type    Null    Key     Default Extra
129
128
d       date    YES             NULL    
130
 
t       time    YES             NULL    
131
129
dt      datetime        YES             NULL    
132
130
drop table t1,t2;
133
131
create table t1 (a int);
387
385
) ENGINE=MEMORY
388
386
SET SESSION storage_engine=default;
389
387
drop table t1;
390
 
create table t1(a int,b int,c int,d date,e char,f datetime,g time,h blob);
 
388
create table t1(a int,b int,c int,d date,e char,f datetime,h blob);
391
389
insert into t1(a)values(1);
392
 
insert into t1(a,b,c,d,e,f,g,h)
393
 
values(2,-2,2,'1825-12-14','a','2003-01-01 03:02:01','4:3:2','binary data');
 
390
insert into t1(a,b,c,d,e,f,h)
 
391
values(2,-2,2,'1825-12-14','a','2003-01-01 03:02:01','binary data');
394
392
select * from t1;
395
 
a       b       c       d       e       f       g       h
396
 
1       NULL    NULL    NULL    NULL    NULL    NULL    NULL
397
 
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     04:03:02        binary data
 
393
a       b       c       d       e       f       h
 
394
1       NULL    NULL    NULL    NULL    NULL    NULL
 
395
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
398
396
select a, 
399
397
ifnull(b,-7) as b, 
400
398
ifnull(c,7) as c, 
401
399
ifnull(d,cast('2000-01-01' as date)) as d, 
402
400
ifnull(e,cast('b' as char)) as e,
403
401
ifnull(f,cast('2000-01-01' as datetime)) as f, 
404
 
ifnull(g,cast('5:4:3' as time)) as g,
405
 
ifnull(h,cast('yet another binary data' as binary)) as h,
406
 
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd 
 
402
ifnull(h,cast('yet another binary data' as binary)) as h
407
403
from t1;
408
 
a       b       c       d       e       f       g       h       dd
409
 
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     05:04:03        yet another binary data 02:00:00
410
 
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     04:03:02        binary data     02:00:00
 
404
a       b       c       d       e       f       h
 
405
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     yet another binary data
 
406
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
411
407
create table t2
412
408
select
413
409
a, 
416
412
ifnull(d,cast('2000-01-01'              as date))     as d,
417
413
ifnull(e,cast('b'                       as char))     as e,
418
414
ifnull(f,cast('2000-01-01'              as datetime)) as f,
419
 
ifnull(g,cast('5:4:3'                   as time))     as g,
420
 
ifnull(h,cast('yet another binary data' as binary))   as h,
421
 
addtime(cast('1:0:0' as time),cast('1:0:0' as time))  as dd
 
415
ifnull(h,cast('yet another binary data' as binary))   as h
422
416
from t1;
423
417
explain t2;
424
418
Field   Type    Null    Key     Default Extra
428
422
d       date    YES             NULL    
429
423
e       varchar(1)      YES             NULL    
430
424
f       datetime        YES             NULL    
431
 
g       time    YES             NULL    
432
425
h       blob    YES             NULL    
433
 
dd      time    YES             NULL    
434
426
select * from t2;
435
 
a       b       c       d       e       f       g       h       dd
436
 
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     05:04:03        yet another binary data 02:00:00
437
 
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     04:03:02        binary data     02:00:00
 
427
a       b       c       d       e       f       h
 
428
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     yet another binary data
 
429
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
438
430
drop table t1, t2;
439
431
create table t1 (a int, b int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), o char(10));
440
432
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
449
441
  `ifnull(g,g)` double(4,3) DEFAULT NULL,
450
442
  `ifnull(h,h)` decimal(5,4) DEFAULT NULL,
451
443
  `ifnull(j,j)` date DEFAULT NULL,
452
 
  `ifnull(k,k)` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
 
444
  `ifnull(k,k)` timestamp NULL DEFAULT NULL,
453
445
  `ifnull(l,l)` datetime DEFAULT NULL,
454
446
  `ifnull(m,m)` varchar(1) DEFAULT NULL,
455
447
  `ifnull(o,o)` varchar(10) DEFAULT NULL