1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug#37601 Cast Is Not Done On Row Comparison

In case of ROW item each compared pair does not
check if argumet collations can be aggregated and
thus appropiriate item conversion does not happen.
The fix is to add the check and convertion for ROW
pairs.
This commit is contained in:
Sergey Glukhov
2009-02-19 17:20:44 +04:00
parent ae9ea0414c
commit 6a9de01a95
5 changed files with 89 additions and 34 deletions

View File

@@ -490,7 +490,8 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
my_error(ER_OPERAND_COLUMNS, MYF(0), (*a)->element_index(i)->cols());
return 1;
}
comparators[i].set_cmp_func(owner, (*a)->addr(i), (*b)->addr(i));
if (comparators[i].set_cmp_func(owner, (*a)->addr(i), (*b)->addr(i)))
return 1;
}
break;
}
@@ -835,6 +836,16 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
get_value_func= &get_time_value;
return 0;
}
else if (type == STRING_RESULT &&
(*a)->result_type() == STRING_RESULT &&
(*b)->result_type() == STRING_RESULT)
{
DTCollation coll;
coll.set((*a)->collation.collation);
if (agg_item_set_converter(coll, owner_arg->func_name(),
b, 1, MY_COLL_CMP_CONV, 1))
return 1;
}
return set_compare_func(owner_arg, type);
}