~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/create.result

  • Committer: Brian Aker
  • Date: 2010-03-02 19:30:45 UTC
  • mfrom: (1309.2.13 build)
  • Revision ID: brian@gaz-20100302193045-s198p433r5ptk6kg
Merge Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
create table t1(x varchar(50) );
108
108
create table t2 select x from t1 where 1=2;
109
109
describe t1;
110
 
Field   Type    Null    Default Default is NULL On Update
 
110
Field   Type    Null    Default Default_is_NULL On_Update
111
111
x       VARCHAR TRUE            TRUE    
112
112
describe t2;
113
 
Field   Type    Null    Default Default is NULL On Update
 
113
Field   Type    Null    Default Default_is_NULL On_Update
114
114
x       VARCHAR TRUE            TRUE    
115
115
drop table t2;
116
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
 
Field   Type    Null    Default Default is NULL On Update
 
118
Field   Type    Null    Default Default_is_NULL On_Update
119
119
a       DATETIME        TRUE            TRUE    
120
120
c       DATE    FALSE           FALSE   
121
121
d       INTEGER FALSE           FALSE   
124
124
drop table t2;
125
125
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("2001-12-29  20:45:11" AS DATETIME) as dt;
126
126
describe t2;
127
 
Field   Type    Null    Default Default is NULL On Update
 
127
Field   Type    Null    Default Default_is_NULL On_Update
128
128
d       DATE    TRUE            TRUE    
129
129
dt      DATETIME        TRUE            TRUE    
130
130
drop table t1,t2;
131
131
create table t1 (a int);
132
132
create table t2 (a int) select * from t1;
133
133
describe t1;
134
 
Field   Type    Null    Default Default is NULL On Update
 
134
Field   Type    Null    Default Default_is_NULL On_Update
135
135
a       INTEGER TRUE            TRUE    
136
136
describe t2;
137
 
Field   Type    Null    Default Default is NULL On Update
 
137
Field   Type    Null    Default Default_is_NULL On_Update
138
138
a       INTEGER TRUE            TRUE    
139
139
drop table if exists t2;
140
140
create table t2 (a int, a float) select * from t1;
418
418
ifnull(h,cast('yet another binary data' as binary))   as h
419
419
from t1;
420
420
explain t2;
421
 
Field   Type    Null    Default Default is NULL On Update
 
421
Field   Type    Null    Default Default_is_NULL On_Update
422
422
a       INTEGER TRUE            TRUE    
423
423
b       BIGINT  FALSE           FALSE   
424
424
c       BIGINT  FALSE           FALSE   
453
453
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
454
454
insert into t1 values ('','',0,0.0);
455
455
describe t1;
456
 
Field   Type    Null    Default Default is NULL On Update
 
456
Field   Type    Null    Default Default_is_NULL On_Update
457
457
str     VARCHAR TRUE    def     FALSE   
458
458
strnull VARCHAR TRUE    def     TRUE    
459
459
intg    INTEGER TRUE    10      FALSE   
460
460
rel     DOUBLE  TRUE    3.14    FALSE   
461
461
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
462
462
describe t2;
463
 
Field   Type    Null    Default Default is NULL On Update
 
463
Field   Type    Null    Default Default_is_NULL On_Update
464
464
str     VARCHAR TRUE            TRUE    
465
465
strnull VARCHAR TRUE            TRUE    
466
466
intg    INTEGER TRUE            TRUE    
468
468
drop table t1, t2;
469
469
create table t1(name varchar(10), age int default -1);
470
470
describe t1;
471
 
Field   Type    Null    Default Default is NULL On Update
 
471
Field   Type    Null    Default Default_is_NULL On_Update
472
472
name    VARCHAR TRUE            TRUE    
473
473
age     INTEGER TRUE    -1      FALSE   
474
474
create table t2(name varchar(10), age int default - 1);
475
475
describe t2;
476
 
Field   Type    Null    Default Default is NULL On Update
 
476
Field   Type    Null    Default Default_is_NULL On_Update
477
477
name    VARCHAR TRUE            TRUE    
478
478
age     INTEGER TRUE    -1      FALSE   
479
479
drop table t1, t2;
522
522
CREATE TABLE t1 (f1 VARCHAR(255));
523
523
CREATE TABLE t2 AS SELECT LEFT(f1,171) AS f2 FROM t1 UNION SELECT LEFT(f1,171) AS f2 FROM t1;
524
524
DESC t2;
525
 
Field   Type    Null    Default Default is NULL On Update
 
525
Field   Type    Null    Default Default_is_NULL On_Update
526
526
f2      VARCHAR TRUE            TRUE    
527
527
DROP TABLE t1,t2;
528
528
CREATE TABLE t12913 (f1 ENUM ('a','b')) AS SELECT 'a' AS f1;