126
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;
126
create table t2 select now() as a , curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
129
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;
129
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
131
131
drop table t1,t2;
338
338
# Test types of data for create select with functions
341
create table t1(a int,b int,c int,d date,e char,f datetime,g time,h blob);
341
create table t1(a int,b int,c int,d date,e char,f datetime,h blob);
342
342
insert into t1(a)values(1);
343
insert into t1(a,b,c,d,e,f,g,h)
344
values(2,-2,2,'1825-12-14','a','2003-01-01 03:02:01','4:3:2','binary data');
343
insert into t1(a,b,c,d,e,f,h)
344
values(2,-2,2,'1825-12-14','a','2003-01-01 03:02:01','binary data');
345
345
select * from t1;
347
347
ifnull(b,-7) as b,
349
349
ifnull(d,cast('2000-01-01' as date)) as d,
350
350
ifnull(e,cast('b' as char)) as e,
351
351
ifnull(f,cast('2000-01-01' as datetime)) as f,
352
ifnull(g,cast('5:4:3' as time)) as g,
353
ifnull(h,cast('yet another binary data' as binary)) as h,
354
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
352
ifnull(h,cast('yet another binary data' as binary)) as h
362
360
ifnull(d,cast('2000-01-01' as date)) as d,
363
361
ifnull(e,cast('b' as char)) as e,
364
362
ifnull(f,cast('2000-01-01' as datetime)) as f,
365
ifnull(g,cast('5:4:3' as time)) as g,
366
ifnull(h,cast('yet another binary data' as binary)) as h,
367
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
363
ifnull(h,cast('yet another binary data' as binary)) as h
370
366
select * from t2;