summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2006-06-14 23:54:08 +0400
committerevgen@moonbone.local <>2006-06-14 23:54:08 +0400
commite35a0ca4b776c101667e447618f808ed0a51ca81 (patch)
tree9f2d34990366073803ede28b005fe7965ee7d736 /sql/item_cmpfunc.h
parent36fae7be6337f4903ffef70fca50afd3be13a978 (diff)
parentc9077f07e708f55ec4241fdb62ebd271707cb824 (diff)
downloadmariadb-git-e35a0ca4b776c101667e447618f808ed0a51ca81.tar.gz
Manually merged
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 1cfdcef02d0..340bf2bb2bf 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -45,8 +45,11 @@ public:
int set_compare_func(Item_bool_func2 *owner, Item_result type);
inline int set_compare_func(Item_bool_func2 *owner_arg)
{
- return set_compare_func(owner_arg, item_cmp_type((*a)->result_type(),
- (*b)->result_type()));
+ Item_result ar= (*a)->result_as_longlong() && (*b)->const_item() ?
+ INT_RESULT : (*a)->result_type();
+ Item_result br= (*b)->result_as_longlong() && (*a)->const_item() ?
+ INT_RESULT : (*b)->result_type();
+ return set_compare_func(owner_arg, item_cmp_type(ar, br));
}
inline int set_cmp_func(Item_bool_func2 *owner_arg,
Item **a1, Item **a2,
@@ -59,8 +62,11 @@ public:
inline int set_cmp_func(Item_bool_func2 *owner_arg,
Item **a1, Item **a2)
{
- return set_cmp_func(owner_arg, a1, a2, item_cmp_type((*a1)->result_type(),
- (*a2)->result_type()));
+ Item_result ar= (*a1)->result_as_longlong() && (*a2)->const_item() ?
+ INT_RESULT : (*a1)->result_type();
+ Item_result br= (*a2)->result_as_longlong() && (*a1)->const_item() ?
+ INT_RESULT : (*a2)->result_type();
+ return set_cmp_func(owner_arg, a1, a2, item_cmp_type(ar, br));
}
inline int compare() { return (this->*func)(); }