~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/cast.result

  • Committer: Jay Pipes
  • Date: 2009-02-04 15:44:25 UTC
  • mfrom: (829 drizzle)
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090204154425-th8xfk2ujz2y8xwg
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
5
5
cast("2001-1-1" as DATE)        cast("2001-1-1" as DATETIME)
6
6
2001-01-01      2001-01-01 00:00:00
 
7
select cast("1:2:3" as TIME);
 
8
cast("1:2:3" as TIME)
 
9
01:02:03
7
10
select CONVERT("2004-01-22 21:45:33",DATE);
8
11
CONVERT("2004-01-22 21:45:33",DATE)
9
12
2004-01-22
89
92
select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00";
90
93
cast("2001-1-1" as datetime) = "2001-01-01 00:00:00"
91
94
1
 
95
select cast("1:2:3" as TIME) = "1:02:03";
 
96
cast("1:2:3" as TIME) = "1:02:03"
 
97
0
92
98
select cast(NULL as DATE);
93
99
cast(NULL as DATE)
94
100
NULL
119
125
select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour);
120
126
date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour)
121
127
2004-12-30 00:00:00
 
128
select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00');
 
129
timediff(cast('2004-12-30 12:00:00' as time), '12:00:00')
 
130
00:00:00
 
131
select timediff(cast('1 12:00:00' as time), '12:00:00');
 
132
timediff(cast('1 12:00:00' as time), '12:00:00')
 
133
24:00:00
122
134
select isnull(date(NULL)), isnull(cast(NULL as DATE));
123
135
isnull(date(NULL))      isnull(cast(NULL as DATE))
124
136
1       1
135
147
select cast(-1e18 as decimal(22,2));
136
148
cast(-1e18 as decimal(22,2))
137
149
-1000000000000000000.00
 
150
create table t1(s1 time);
 
151
insert into t1 values ('11:11:11');
 
152
select cast(s1 as decimal(7,2)) from t1;
 
153
cast(s1 as decimal(7,2))
 
154
99999.99
 
155
Warnings:
 
156
Error   1264    Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
 
157
drop table t1;
138
158
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
139
159
mt mediumtext, lt longtext);
140
160
INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');