~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/create.test

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
--error 1067
62
62
create table t1 (a int default 100 auto_increment);
63
63
--error 1067
64
 
create table t1 (a tinyint default 1000);
 
64
create table t1 (a int default 1000);
65
65
--error 1067
66
66
create table t1 (a varchar(5) default 'abcdef');
67
67
 
132
132
# Test of CREATE ... SELECT with duplicate fields
133
133
#
134
134
 
135
 
create table t1 (a tinyint);
 
135
create table t1 (a int);
136
136
create table t2 (a int) select * from t1;                        
137
137
describe t1;
138
138
describe t2;
334
334
# Test types of data for create select with functions
335
335
#
336
336
 
337
 
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
 
337
create table t1(a int,b int,c int,d date,e char,f datetime,g time,h blob);
338
338
insert into t1(a)values(1);
339
339
insert into t1(a,b,c,d,e,f,g,h)
340
340
values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data');
341
341
select * from t1;
342
342
select a, 
343
343
    ifnull(b,cast(-7 as signed)) as b, 
344
 
    ifnull(c,cast(7 as unsigned)) as c, 
 
344
    ifnull(c,cast(7 as)) as c, 
345
345
    ifnull(d,cast('2000-01-01' as date)) as d, 
346
346
    ifnull(e,cast('b' as char)) as e,
347
347
    ifnull(f,cast('2000-01-01' as datetime)) as f, 
354
354
select
355
355
    a, 
356
356
    ifnull(b,cast(-7                        as signed))   as b,
357
 
    ifnull(c,cast(7                         as unsigned)) as c,
 
357
    ifnull(c,cast(7                         as)) as c,
358
358
    ifnull(d,cast('2000-01-01'              as date))     as d,
359
359
    ifnull(e,cast('b'                       as char))     as e,
360
360
    ifnull(f,cast('2000-01-01'              as datetime)) as f,
366
366
select * from t2;
367
367
drop table t1, t2;
368
368
 
369
 
create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
 
369
create table t1 (a int, b int, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
370
370
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(i,i), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(n,n), ifnull(o,o) from t1;
371
371
show create table t2;
372
372
drop table t1,t2;
385
385
# Bug #2075
386
386
#
387
387
 
388
 
create table t1(name varchar(10), age smallint default -1);
 
388
create table t1(name varchar(10), age int default -1);
389
389
describe t1;
390
 
create table t2(name varchar(10), age smallint default - 1);
 
390
create table t2(name varchar(10), age int default - 1);
391
391
describe t2;
392
392
drop table t1, t2;
393
393