diff options
-rw-r--r-- | mysql-test/r/ctype_latin1_de.result | 4 | ||||
-rw-r--r-- | mysql-test/t/ctype_latin1_de.test | 1 | ||||
-rw-r--r-- | sql/item_func.cc | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 418bd65e0dc..7503c16a85e 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -278,4 +278,8 @@ s1 COUNT(*) SELECT COUNT(DISTINCT s1) FROM t1; COUNT(DISTINCT s1) 1 +SELECT FIELD('ue',s1), FIELD('Ü',s1), s1='ue', s1='Ü' FROM t1; +FIELD('ue',s1) FIELD('Ü',s1) s1='ue' s1='Ü' +1 1 1 1 +1 1 1 1 DROP TABLE t1; diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index 0bbd9fa95e4..00ac128a478 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -82,4 +82,5 @@ INSERT INTO t1 VALUES ('ue'); SELECT DISTINCT s1 FROM t1; SELECT s1,COUNT(*) FROM t1 GROUP BY s1; SELECT COUNT(DISTINCT s1) FROM t1; +SELECT FIELD('ue',s1), FIELD('Ü',s1), s1='ue', s1='Ü' FROM t1; DROP TABLE t1; diff --git a/sql/item_func.cc b/sql/item_func.cc index e1092dda857..843fe6cd350 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1183,8 +1183,7 @@ longlong Item_func_field::val_int() for (uint i=1 ; i < arg_count ; i++) { String *tmp_value=args[i]->val_str(&tmp); - if (tmp_value && field->length() == tmp_value->length() && - !sortcmp(field,tmp_value,cmp_collation.collation)) + if (tmp_value && !sortcmp(field,tmp_value,cmp_collation.collation)) return (longlong) (i); } } |