32
32
create table t1 (a enum ('0','1'));
33
--error 1691 # Bad enum
33
--error ER_INVALID_ENUM_VALUE # Bad enum
34
34
insert into t1 set a='foobar';
36
36
update t1 set a = replace(a,'x','y');
43
#create table t1 (a enum(0xE4, '1', '2') not null default 0xE4);
44
#show columns from t1;
45
#show create table t1;
48
# Test currently turned off because of this bug:
49
# Bug 308841 queries with German umlauts in insert statem
42
# Drizzle -> We only handle UTF-8 for ENUM names.
44
--error ER_CORRUPT_TABLE_DEFINITION
45
create table t1 (a enum(0xE4, '1', '2') not null default 0xE4);
47
# and now with what it's meant to be doing (from looking at mysql result)
48
create table t1 (a enum(0xC3A4, '1', '2') not null default 0xC3A4);
51
54
# Bug #5628 German characters in field-defs will be '?'
52
55
# with some table definitions
57
# b ENUM('value','���_value','���') character set latin1 NOT NULL
59
#show create table t1;
60
#show columns from t1;
63
# Test currently turned off because of this bug:
64
# Bug 308841 queries with German umlauts in insert statem
65
#CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate utf8_swedish_ci);
66
#INSERT INTO t1 VALUES ('�'),('�'),('�'),('�');
70
# Test currently turned off because of this bug:
71
# Bug 308841 queries with German umlauts in insert statements fail
57
# Drizzle -> We only handle UTF-8 for ENUM names.
73
# Bug #6379: ENUM values are incorrectly converted
59
--error ER_CORRUPT_TABLE_DEFINITION
62
b ENUM('value','���_value','���') NOT NULL
65
# in utf8 land we don't convert � into ae to store in latin1 encoding.
66
# I think this is correct.
67
CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate utf8_unicode_ci);
68
--error ER_INVALID_ENUM_VALUE
69
INSERT INTO t1 VALUES ('�');
70
--error ER_INVALID_ENUM_VALUE
71
INSERT INTO t1 values ('�');
72
--error ER_INVALID_ENUM_VALUE
73
INSERT INTO t1 values ('�');
74
--error ER_INVALID_ENUM_VALUE
75
INSERT INTO t1 values ('�');
79
# MySQL Bug #6379: ENUM values are incorrectly converted
75
81
# Check latin1 -> utf8 conversion
78
# a ENUM('�','�','�') character set utf8 default '�'
80
#show create table t1;
81
#insert into t1 values ('�'), ('�'), ('�');
82
#select a from t1 order by a;
82
# (this is semi-pointless for Drizzle)
84
# Drizzle -> We only handle UTF-8 for ENUM names.
86
--error ER_CORRUPT_TABLE_DEFINITION
88
a ENUM('�','�','�') default '�'
85
91
# Test currently turned off because of this bug:
86
92
# Bug 308841 queries with German umlauts in insert statements fail
88
94
# Now check utf8 -> latin1 conversion
89
95
# This test emulates loading a script generated with mysqldump
92
# a ENUM('ä','ö','ü') character set latin1 default 'ü'
94
#insert into t1 values ('ä'),('ö'),('ü');
97
# (this is semi pointless with Drizzle as we're just UTF8... but syntax should work)
100
a ENUM('ä','ö','ü') default 'ü'
102
insert into t1 values ('ä'),('ö'),('ü');
95
103
# Now check what has been loaded
96
#show create table t1;
97
#select a from t1 order by a;
104
show create table t1;
105
select a from t1 order by a;
101
109
# Test bug where enum fields where extended for each ALTER TABLE
121
129
# Bug#24660 "enum" field type definition problem
123
#create table t1(russian enum('E','F','E�F','F�E') NOT NULL DEFAULT'E');
124
#show create table t1;
127
#create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
128
#show create table t1;
131
#create table t1(russian_deviant enum('E','F','E�F','F,E') NOT NULL DEFAULT'E');
132
#show create table t1;
131
# Drizzle -> We only handle UTF-8 for ENUM names.
133
--error ER_CORRUPT_TABLE_DEFINITION
134
create table t1(russian enum('E','F','E�F','F�E') NOT NULL DEFAULT'E');
137
create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
138
show create table t1;
141
# Drizzle -> We only handle UTF-8 for ENUM names.
143
--error ER_CORRUPT_TABLE_DEFINITION
144
create table t1(russian_deviant enum('E','F','E�F','F,E') NOT NULL DEFAULT'E');
136
147
# Bug #29251: MySQL coerces special 0 enum values to normal '' value
141
152
id INT AUTO_INCREMENT PRIMARY KEY,
142
153
c1 ENUM('a', '', 'b')
144
--error 1691 # 0 is not valid way to insert. Must use 1-based index of key.
155
--error ER_INVALID_ENUM_VALUE # 0 is not valid way to insert. Must use 1-based index of key.
145
156
INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
146
--error 1691 # 0 is not valid way to insert. Must use 1-based index of key.
157
--error ER_INVALID_ENUM_VALUE # 0 is not valid way to insert. Must use 1-based index of key.
147
158
INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
148
159
INSERT INTO t1 (c1) VALUES ('a'), ('b');
149
160
SELECT id, c1 + 0, c1 FROM t1;
151
--error 1691 # Bad en
162
--error ER_INVALID_ENUM_VALUE # Bad en
152
163
ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
153
164
# Below works because '' was not inserted in any statement above...
154
165
ALTER TABLE t1 CHANGE c1 c1 ENUM('a', 'b') NOT NULL;
194
205
CREATE TABLE t1(a enum('a','b','c','d'));
195
--error 1691 # Bad enum 0
206
--error ER_INVALID_ENUM_VALUE # Bad enum 0
196
207
INSERT INTO t1 VALUES (4),(1),(0),(3);
197
208
INSERT INTO t1 VALUES (4),(1),(2),(3);