Commit 929d1a16 authored by unknown's avatar unknown

Bug #4555 ALTER TABLE crashes mysqld with enum column collated utf8_unicode_ci

parent 9d670dfa
......@@ -240,3 +240,6 @@ select 'zвася' rlike '[[:<:]]вася[[:>:]]';
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
0
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
DROP TABLE t1;
......@@ -157,3 +157,11 @@ select ' вася ' rlike '[[:<:]]вася[[:>:]]';
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
#
# Bug #4555
# ALTER TABLE crashes mysqld with enum column collated utf8_unicode_ci
#
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
DROP TABLE t1;
......@@ -5625,8 +5625,11 @@ bool Field_enum::eq_def(Field *field)
if (typelib->count < from_lib->count)
return 0;
for (uint i=0 ; i < from_lib->count ; i++)
if (my_strcasecmp(field_charset,
typelib->type_names[i],from_lib->type_names[i]))
if (my_strnncoll(field_charset,
(const uchar*)typelib->type_names[i],
strlen(typelib->type_names[i]),
(const uchar*)from_lib->type_names[i],
strlen(from_lib->type_names[i])))
return 0;
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment