Loading myisam/mi_unique.c +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b, if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT) { if (mi_compare_text(keyseg->charset, (uchar *) pos_a, length, (uchar *) pos_b, length, 0, 0)) (uchar *) pos_b, length, 0, 1)) return 1; } else Loading mysql-test/r/ctype_utf8.result +16 −0 Original line number Diff line number Diff line Loading @@ -1293,3 +1293,19 @@ id tid val 42749 72 VOLN ADSL 44205 72 VOLN ADSL DROP TABLE t1; create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary select distinct a from t1; a e explain select a from t1 group by a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort select a from t1 group by a; a e drop table t1; mysql-test/t/ctype_utf8.test +14 −0 Original line number Diff line number Diff line Loading @@ -1040,4 +1040,18 @@ ALTER TABLE t1 ADD KEY idx (tid,val(11)); SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL'; DROP TABLE t1; # # Bug 20709: problem with utf8 fields in temporary tables # create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; select distinct a from t1; explain select a from t1 group by a; select a from t1 group by a; drop table t1; # End of 4.1 tests Loading
myisam/mi_unique.c +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b, if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT) { if (mi_compare_text(keyseg->charset, (uchar *) pos_a, length, (uchar *) pos_b, length, 0, 0)) (uchar *) pos_b, length, 0, 1)) return 1; } else Loading
mysql-test/r/ctype_utf8.result +16 −0 Original line number Diff line number Diff line Loading @@ -1293,3 +1293,19 @@ id tid val 42749 72 VOLN ADSL 44205 72 VOLN ADSL DROP TABLE t1; create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary select distinct a from t1; a e explain select a from t1 group by a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort select a from t1 group by a; a e drop table t1;
mysql-test/t/ctype_utf8.test +14 −0 Original line number Diff line number Diff line Loading @@ -1040,4 +1040,18 @@ ALTER TABLE t1 ADD KEY idx (tid,val(11)); SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL'; DROP TABLE t1; # # Bug 20709: problem with utf8 fields in temporary tables # create table t1(a char(200) collate utf8_unicode_ci NOT NULL default '') default charset=utf8 collate=utf8_unicode_ci; insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); explain select distinct a from t1; select distinct a from t1; explain select a from t1 group by a; select a from t1 group by a; drop table t1; # End of 4.1 tests