summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorbar@bar.mysql.r18.ru <>2003-03-21 19:02:07 +0400
committerbar@bar.mysql.r18.ru <>2003-03-21 19:02:07 +0400
commit6b18a618eb60d1c01d6dcd70804ab705d080a760 (patch)
tree9547ce5a53b27fdb108ef05ec2d5df71881833b0 /sql/item_cmpfunc.cc
parentb3e89e3b21bcfc68423595c7c7f8962867c5c44d (diff)
downloadmariadb-git-6b18a618eb60d1c01d6dcd70804ab705d080a760.tar.gz
item_cmpfunc.cc:
IFNULL() now honors collations
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index e63f0a836de..4d2aaf5a0f2 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -650,6 +650,9 @@ Item_func_ifnull::fix_length_and_dec()
args[1]->result_type())) !=
REAL_RESULT)
decimals= 0;
+ if (set_charset(args[0]->charset(),args[0]->coercibility,
+ args[1]->charset(),args[1]->coercibility))
+ my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name());
}
@@ -690,11 +693,13 @@ Item_func_ifnull::val_str(String *str)
if (!args[0]->null_value)
{
null_value=0;
+ res->set_charset(charset());
return res;
}
res=args[1]->val_str(str);
if ((null_value=args[1]->null_value))
return 0;
+ res->set_charset(charset());
return res;
}