Commit 970f910d authored by unknown's avatar unknown

Fix:

CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german2_ci);
INSERT INTO t1 VALUES ('Ü');
SELECT FIELD('ue',s1) FROM t1;
The above returned 0 in error.
Now 1 is returned.

parent fc8b1385
......@@ -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;
......@@ -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;
......@@ -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);
}
}
......
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