~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/case.test

  • Committer: Monty Taylor
  • Date: 2009-01-29 19:04:39 UTC
  • mto: (779.3.29 devel)
  • mto: This revision was merged to the branch mainline in revision 823.
  • Revision ID: mordred@inaugust.com-20090129190439-vfr95s6gaudjacm7
Add timegm which is missing on Solaris.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END;
19
19
select (CASE "two" when "one" then "1" WHEN "two" then "2" END);
20
20
select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0;
21
 
--error ER_DIVISION_BY_ZERO
22
21
select case 1/0 when "a" then "true" else "false" END;
23
 
--error ER_DIVISION_BY_ZERO
24
22
select case 1/0 when "a" then "true" END;
25
 
--error ER_DIVISION_BY_ZERO
26
23
select (case 1/0 when "a" then "true" END);
27
 
--error ER_DIVISION_BY_ZERO
28
24
select (case 1/0 when "a" then "true" END) + 0.0;
29
25
select case when 1>0 then "TRUE" else "FALSE" END;
30
26
select case when 1<0 then "TRUE" else "FALSE" END;
65
61
 CASE WHEN 1 THEN 0.1e1 else 1 END AS c11,
66
62
 CASE WHEN 1 THEN 0.1e1 else '1' END AS c12
67
63
;
68
 
 
69
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
70
64
SHOW CREATE TABLE t1;
71
65
DROP TABLE t1;
72
66
 
73
 
--error ER_CANT_AGGREGATE_2COLLATIONS
 
67
--error 1267
74
68
SELECT CASE 
75
69
  WHEN 1 
76
70
  THEN 'a' COLLATE utf8_bin 
77
71
  ELSE 'a' COLLATE utf8_swedish_ci
78
72
  END;
79
73
 
80
 
--error ER_CANT_AGGREGATE_3COLLATIONS
 
74
--error 1270
81
75
SELECT CASE 'a' COLLATE utf8_bin
82
76
  WHEN 'a' COLLATE utf8_danish_ci  THEN 1
83
77
  WHEN 'a' COLLATE utf8_swedish_ci THEN 2
100
94
#
101
95
# Check COALESCE argument types aggregation
102
96
 
103
 
--error ER_CANT_AGGREGATE_2COLLATIONS
 
97
--error 1267
104
98
CREATE TABLE t1 SELECT COALESCE('a' COLLATE utf8_swedish_ci,'b' COLLATE utf8_bin);
105
99
CREATE TABLE t1 SELECT 
106
100
 COALESCE(1), COALESCE(1.0),COALESCE('a'),
110
104
 COALESCE(1), COALESCE(1.0),COALESCE('a'),
111
105
 COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'),
112
106
 COALESCE('a' COLLATE utf8_bin,'b');
113
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
114
107
SHOW CREATE TABLE t1;
115
108
DROP TABLE t1;
116
109
 
161
154
#
162
155
# #30782: Truncated BIGINT columns 
163
156
#
164
 
create table t1 (a int, b bigint unsigned);
 
157
create table t1 (a int, b bigint);
165
158
create table t2 (c int);
166
159
insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997),
167
160
  (3,11120436154190595086);