From 62ad8922b84ee93db1fc4b9c7b76b7c99d9d6976 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 7 Oct 2005 09:52:15 +0500 Subject: [PATCH] ctype_utf8.result, ctype_utf8.test: Adding test case. item_func.cc: Bug#13751 find_in_set: Illegal mix of collations. Character set conversion was forgotten in find_in_set. --- mysql-test/r/ctype_utf8.result | 5 +++++ mysql-test/t/ctype_utf8.test | 8 ++++++++ sql/item_func.cc | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index aeea574ef6c..c7606b918df 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1056,3 +1056,8 @@ hex(a) 5B E880BD drop table t1; +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +a +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 23824a58dab..dcb7469d46e 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -865,4 +865,12 @@ insert into t1 values (_utf8 0x5b); select hex(a) from t1; drop table t1; +# +# Bug#13751 find_in_set: Illegal mix of collations +# +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +drop table t1; + # End of 4.1 tests diff --git a/sql/item_func.cc b/sql/item_func.cc index ebb200ec4da..288859443ff 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1454,7 +1454,7 @@ void Item_func_find_in_set::fix_length_and_dec() } } } - agg_arg_collations_for_comparison(cmp_collation, args, 2); + agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV); } static const char separator=',';