~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/create.test

  • Committer: Brian Aker
  • Date: 2009-03-01 03:29:52 UTC
  • mfrom: (907.1.6 trunk-with-temporal)
  • Revision ID: brian@tangent.org-20090301032952-y210opnqxsfyhcla
Merge Jay's temporal

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
describe t1;
124
124
describe t2;
125
125
drop table t2;
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;
127
127
describe t2;
128
128
drop table t2;
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;
130
130
describe t2;
131
131
drop table t1,t2;
132
132
 
217
217
#
218
218
 
219
219
create table t1 select 1,2,3;
 
220
--error 1364
220
221
create table if not exists t1 select 1,2;
 
222
--error 1136
221
223
create table if not exists t1 select 1,2,3,4;
 
224
--error 1364
222
225
create table if not exists t1 select 1;
223
226
select * from t1;
224
227
drop table t1;
338
341
# Test types of data for create select with functions
339
342
#
340
343
 
341
 
create table t1(a int,b int,c int,d date,e char,f datetime,g time,h blob);
 
344
create table t1(a int,b int,c int,d date,e char,f datetime,h blob);
342
345
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');
 
346
insert into t1(a,b,c,d,e,f,h)
 
347
values(2,-2,2,'1825-12-14','a','2003-01-01 03:02:01','binary data');
345
348
select * from t1;
346
349
select a, 
347
350
    ifnull(b,-7) as b, 
349
352
    ifnull(d,cast('2000-01-01' as date)) as d, 
350
353
    ifnull(e,cast('b' as char)) as e,
351
354
    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 
 
355
    ifnull(h,cast('yet another binary data' as binary)) as h
355
356
from t1;
356
357
 
357
358
create table t2
362
363
    ifnull(d,cast('2000-01-01'              as date))     as d,
363
364
    ifnull(e,cast('b'                       as char))     as e,
364
365
    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
 
366
    ifnull(h,cast('yet another binary data' as binary))   as h
368
367
from t1;
369
368
explain t2;
370
369
select * from t2;
469
468
# an improper fix is present.
470
469
#
471
470
create table t1 (a int);
472
 
## TODO: Should this statement fail?
473
 
#--error 1093
 
471
--error 1093
474
472
create table t1 select * from t1;
475
473
## TODO: Huh? --error ER_WRONG_OBJECT
476
474
#create table t2 union = (t1) select * from t1;