summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-07-18 12:42:35 +0500
committerunknown <bar@bar.mysql.r18.ru>2003-07-18 12:42:35 +0500
commita975548b53bde25032c6d381bba7dd9872111124 (patch)
tree07fbba18e54054e03f96d89b0e8db88fc0506a87 /sql
parent926b05ed0ebd6bb00fe762fa79f80a38250285d0 (diff)
downloadmariadb-git-a975548b53bde25032c6d381bba7dd9872111124.tar.gz
Some fixes in CASE.
Test suit was extended to conver various arguments mixes.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 1f1b449e9a7..b73499942a3 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -892,7 +892,7 @@ Item *Item_func_case::find_item(String *str)
}
if ((tmp=args[i]->val_str(str))) // If not null
{
- if (sortcmp(tmp,first_expr_str,&my_charset_bin)==0)
+ if (sortcmp(tmp,first_expr_str,cmp_collation.collation)==0)
return args[i+1];
}
break;
@@ -1027,7 +1027,7 @@ void Item_func_case::fix_length_and_dec()
{
agg[0]= args[first_expr_num];
for (nagg= 0; nagg < ncases/2 ; nagg++)
- agg[nagg+1]= args[nagg];
+ agg[nagg+1]= args[nagg*2];
nagg++;
agg_cmp_type(&cmp_type, agg, nagg);
if ((cmp_type == STRING_RESULT) &&
@@ -1040,7 +1040,6 @@ void Item_func_case::fix_length_and_dec()
max_length=0;
decimals=0;
- cached_result_type = args[1]->result_type();
for (uint i=0 ; i < ncases ; i+=2)
{
set_if_bigger(max_length,args[i+1]->max_length);