From ce17ac5af299e040499b355e30b3fcdacdf02712 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Mar 2003 18:31:41 +0400 Subject: IF() and LEAST() now honors coercibility --- sql/item_func.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sql/item_func.cc') diff --git a/sql/item_func.cc b/sql/item_func.cc index 72db23d1953..5bbb6003e4f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -855,9 +855,13 @@ void Item_func_min_max::fix_length_and_dec() maybe_null=0; cmp_type=item_cmp_type(cmp_type,args[i]->result_type()); if (i==0) - set_charset(args[i]->charset()); - else if (args[i]->charset() == &my_charset_bin) - set_charset(&my_charset_bin); + set_charset(args[i]->charset(), args[i]->coercibility); + else if (set_charset(charset(), coercibility, + args[i]->charset(), args[i]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + break; + } } } @@ -909,6 +913,7 @@ String *Item_func_min_max::val_str(String *str) } } } + res->set_charset(charset()); return res; } case ROW_RESULT: -- cgit v1.2.1