Merge lp:~stewart/drizzle/bug579311-enum-test into lp:~drizzle-trunk/drizzle/development

Proposed by Stewart Smith
Status: Merged
Merged at revision: 1594
Proposed branch: lp:~stewart/drizzle/bug579311-enum-test
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 271 lines (+166/-56)
2 files modified
tests/r/type_enum.result (+100/-0)
tests/t/type_enum.test (+66/-56)
To merge this branch: bzr merge lp:~stewart/drizzle/bug579311-enum-test
Reviewer Review Type Date Requested Status
Brian Aker Approve
Patrick Crews Pending
Drizzle Developers Pending
Review via email: mp+26655@code.launchpad.net

Description of the change

fix up remaining bits of type_enum test

To post a comment you must log in.
Revision history for this message
Brian Aker (brianaker) wrote :

Hi!

Can you test this with pushbuild?

Cheers,
   -Brian

review: Needs Information
Revision history for this message
Brian Aker (brianaker) wrote :

> Hi!
>
> Can you test this with pushbuild?
>
> Cheers,
> -Brian

Heh... I mean param-build :)

Revision history for this message
Stewart Smith (stewart) wrote :
Revision history for this message
Brian Aker (brianaker) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/r/type_enum.result'
2--- tests/r/type_enum.result 2009-11-12 18:06:39 +0000
3+++ tests/r/type_enum.result 2010-06-03 00:49:21 +0000
4@@ -1645,6 +1645,85 @@
5 select * from t1;
6 a
7 drop table t1;
8+create table t1 (a enum(0xE4, '1', '2') not null default 0xE4);
9+show columns from t1;
10+Field Type Null Default Default_is_NULL On_Update
11+a ENUM FALSE FALSE
12+Warnings:
13+Warning 1366 Incorrect string value: '\xE4' for column 'Default' at row 0
14+show create table t1;
15+Table Create Table
16+t1 CREATE TABLE `t1` (
17+ `a` enum('ä','1','2') NOT NULL DEFAULT 'ä'
18+) ENGINE=InnoDB
19+drop table t1;
20+create table t1 (a enum(0xC3A4, '1', '2') not null default 0xC3A4);
21+show columns from t1;
22+Field Type Null Default Default_is_NULL On_Update
23+a ENUM FALSE ä FALSE
24+show create table t1;
25+Table Create Table
26+t1 CREATE TABLE `t1` (
27+ `a` enum('ä','1','2') NOT NULL DEFAULT 'ä'
28+) ENGINE=InnoDB
29+drop table t1;
30+CREATE TABLE t1 (
31+a INT default 1,
32+b ENUM('value','öäü_value','ÊÃÕ') NOT NULL
33+);
34+show create table t1;
35+Table Create Table
36+t1 CREATE TABLE `t1` (
37+ `a` int DEFAULT '1',
38+ `b` enum('value','öäü_value','ÊÃÕ') NOT NULL
39+) ENGINE=InnoDB
40+show columns from t1;
41+Field Type Null Default Default_is_NULL On_Update
42+a INTEGER TRUE 1 FALSE
43+b ENUM FALSE FALSE
44+drop table t1;
45+CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate utf8_unicode_ci);
46+INSERT INTO t1 VALUES ('ä');
47+ERROR HY000: Received an invalid enum value 'ä'.
48+INSERT INTO t1 values ('ö');
49+ERROR HY000: Received an invalid enum value 'ö'.
50+INSERT INTO t1 values ('ü');
51+ERROR HY000: Received an invalid enum value 'ü'.
52+INSERT INTO t1 values ('ß');
53+ERROR HY000: Received an invalid enum value 'ß'.
54+SELECT * FROM t1;
55+c
56+DROP TABLE t1;
57+CREATE TABLE t1 (
58+a ENUM('ä','ö','ü') default 'ü'
59+);
60+show create table t1;
61+Table Create Table
62+t1 CREATE TABLE `t1` (
63+ `a` enum('ä','ö','ü') DEFAULT 'ü'
64+) ENGINE=InnoDB
65+insert into t1 values ('ä'), ('ö'), ('ü');
66+select a from t1 order by a;
67+a
68
69
70
71+drop table t1;
72+CREATE TABLE t1 (
73+a ENUM('ä','ö','ü') default 'ü'
74+);
75+insert into t1 values ('ä'),('ö'),('ü');
76+show create table t1;
77+Table Create Table
78+t1 CREATE TABLE `t1` (
79+ `a` enum('ä','ö','ü') DEFAULT 'ü'
80+) ENGINE=InnoDB
81+select a from t1 order by a;
82+a
83+ä
84+ö
85+ü
86+drop table t1;
87 create table t1 (a enum ('Y','N') COLLATE utf8_bin);
88 insert into t1 values ('Y');
89 alter table t1 add c enum ('Y','N') COLLATE utf8_bin;
90@@ -1664,6 +1743,27 @@
91 `f2` enum('Y','N') DEFAULT NULL
92 ) ENGINE=InnoDB
93 drop table t1;
94+create table t1(russian enum('E','F','EÿF','FÿE') NOT NULL DEFAULT'E');
95+show create table t1;
96+Table Create Table
97+t1 CREATE TABLE `t1` (
98+ `russian` enum('E','F','EÿF','FÿE') NOT NULL DEFAULT 'E'
99+) ENGINE=InnoDB
100+drop table t1;
101+create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
102+show create table t1;
103+Table Create Table
104+t1 CREATE TABLE `t1` (
105+ `denormal` enum('E','F','E,F','F,E') NOT NULL DEFAULT 'E'
106+) ENGINE=InnoDB
107+drop table t1;
108+create table t1(russian_deviant enum('E','F','EÿF','F,E') NOT NULL DEFAULT'E');
109+show create table t1;
110+Table Create Table
111+t1 CREATE TABLE `t1` (
112+ `russian_deviant` enum('E','F','EÿF','F,E') NOT NULL DEFAULT 'E'
113+) ENGINE=InnoDB
114+drop table t1;
115 CREATE TABLE t1 (
116 id INT AUTO_INCREMENT PRIMARY KEY,
117 c1 ENUM('a', '', 'b')
118
119=== modified file 'tests/t/type_enum.test'
120--- tests/t/type_enum.test 2009-11-12 18:06:39 +0000
121+++ tests/t/type_enum.test 2010-06-03 00:49:21 +0000
122@@ -37,50 +37,58 @@
123 select * from t1;
124 drop table t1;
125
126-##
127-## Bug #2077
128-##
129-#create table t1 (a enum(0xE4, '1', '2') not null default 0xE4);
130-#show columns from t1;
131-#show create table t1;
132-#drop table t1;
133-
134-# Test currently turned off because of this bug:
135-# Bug 308841 queries with German umlauts in insert statem
136-#
137+#
138+# Bug #2077
139+#
140+create table t1 (a enum(0xE4, '1', '2') not null default 0xE4);
141+show columns from t1;
142+show create table t1;
143+drop table t1;
144+
145+# and now with what it's meant to be doing (from looking at mysql result)
146+create table t1 (a enum(0xC3A4, '1', '2') not null default 0xC3A4);
147+show columns from t1;
148+show create table t1;
149+drop table t1;
150+
151+
152 # Bug #5628 German characters in field-defs will be '?'
153 # with some table definitions
154 #
155-#set names latin1;
156-#CREATE TABLE t1 (
157-# a INT default 1,
158-# b ENUM('value','öäü_value','ÊÃÕ') character set latin1 NOT NULL
159-#);
160-#show create table t1;
161-#show columns from t1;
162-#drop table t1;
163-
164-# Test currently turned off because of this bug:
165-# Bug 308841 queries with German umlauts in insert statem
166-#CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate utf8_swedish_ci);
167-#INSERT INTO t1 VALUES ('ä'),('ö'),('ü'),('ß');
168-#SELECT * FROM t1;
169-#DROP TABLE t1;
170-
171-# Test currently turned off because of this bug:
172-# Bug 308841 queries with German umlauts in insert statements fail
173-#
174-# Bug #6379: ENUM values are incorrectly converted
175+CREATE TABLE t1 (
176+ a INT default 1,
177+ b ENUM('value','öäü_value','ÊÃÕ') NOT NULL
178+);
179+show create table t1;
180+show columns from t1;
181+drop table t1;
182+
183+# in utf8 land we don't convert ä into ae to store in latin1 encoding.
184+# I think this is correct.
185+CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate utf8_unicode_ci);
186+--error 1691
187+INSERT INTO t1 VALUES ('ä');
188+--error 1691
189+INSERT INTO t1 values ('ö');
190+--error 1691
191+INSERT INTO t1 values ('ü');
192+--error 1691
193+INSERT INTO t1 values ('ß');
194+SELECT * FROM t1;
195+DROP TABLE t1;
196+
197+# MySQL Bug #6379: ENUM values are incorrectly converted
198 #
199 # Check latin1 -> utf8 conversion
200+# (this is semi-pointless for Drizzle)
201 #
202-#CREATE TABLE t1 (
203-# a ENUM('ä','ö','ü') character set utf8 default 'ü'
204-#);
205-#show create table t1;
206-#insert into t1 values ('ä'), ('ö'), ('ü');
207-#select a from t1 order by a;
208-#drop table t1;
209+CREATE TABLE t1 (
210+ a ENUM('ä','ö','ü') default 'ü'
211+);
212+show create table t1;
213+insert into t1 values ('ä'), ('ö'), ('ü');
214+select a from t1 order by a;
215+drop table t1;
216
217 # Test currently turned off because of this bug:
218 # Bug 308841 queries with German umlauts in insert statements fail
219@@ -88,14 +96,16 @@
220 # Now check utf8 -> latin1 conversion
221 # This test emulates loading a script generated with mysqldump
222 #
223-#CREATE TABLE t1 (
224-# a ENUM('ä','ö','ü') character set latin1 default 'ü'
225-#);
226-#insert into t1 values ('ä'),('ö'),('ü');
227+# (this is semi pointless with Drizzle as we're just UTF8... but syntax should work)
228+#
229+CREATE TABLE t1 (
230+ a ENUM('ä','ö','ü') default 'ü'
231+);
232+insert into t1 values ('ä'),('ö'),('ü');
233 # Now check what has been loaded
234-#show create table t1;
235-#select a from t1 order by a;
236-#drop table t1;
237+show create table t1;
238+select a from t1 order by a;
239+drop table t1;
240
241 #
242 # Test bug where enum fields where extended for each ALTER TABLE
243@@ -120,17 +130,17 @@
244 #
245 # Bug#24660 "enum" field type definition problem
246 #
247-#create table t1(russian enum('E','F','EÿF','FÿE') NOT NULL DEFAULT'E');
248-#show create table t1;
249-#drop table t1;
250-#
251-#create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
252-#show create table t1;
253-#drop table t1;
254-#
255-#create table t1(russian_deviant enum('E','F','EÿF','F,E') NOT NULL DEFAULT'E');
256-#show create table t1;
257-#drop table t1;
258+create table t1(russian enum('E','F','EÿF','FÿE') NOT NULL DEFAULT'E');
259+show create table t1;
260+drop table t1;
261+#
262+create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
263+show create table t1;
264+drop table t1;
265+#
266+create table t1(russian_deviant enum('E','F','EÿF','F,E') NOT NULL DEFAULT'E');
267+show create table t1;
268+drop table t1;
269
270 #
271 # Bug #29251: MySQL coerces special 0 enum values to normal '' value