~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/cast.test

mergeĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
# binaries built with Visual C++ 2005
11
11
select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A";
12
12
select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
13
 
select cast("1:2:3" as TIME);
14
13
select CONVERT("2004-01-22 21:45:33",DATE);
15
14
select 10+'10';
16
15
select 10.0+'10';
72
71
 
73
72
select cast("2001-1-1" as date) = "2001-01-01";
74
73
select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00";
75
 
select cast("1:2:3" as TIME) = "1:02:03";
76
74
select cast(NULL as DATE);
77
75
select cast(NULL as BINARY);
78
76
 
93
91
# time/date parts (correspondingly).
94
92
#
95
93
select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour);
96
 
select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00');
97
94
# Still we should not throw away "days" part of time value
98
 
select timediff(cast('1 12:00:00' as time), '12:00:00');
99
95
 
100
96
#
101
97
# Bug #23938: cast(NULL as DATE)
112
108
select cast(@v1 as decimal(22, 2));
113
109
select cast(-1e18 as decimal(22,2));
114
110
 
115
 
create table t1(s1 time);
116
 
insert into t1 values ('11:11:11');
117
 
select cast(s1 as decimal(7,2)) from t1;
118
 
drop table t1;
119
 
 
120
 
#
121
111
# Test for bug #11283: field conversion from varchar, and text types to decimal
122
112
#
123
113