diff options
author | unknown <evgen@moonbone.local> | 2006-06-15 16:41:26 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2006-06-15 16:41:26 +0400 |
commit | 629830d9626472f8deab45e9e9125518b0a2b4d6 (patch) | |
tree | c2a3d7ba1e5b230003e5d36189c7247a0763f8b1 | |
parent | 99c320d7cfeb862d25ab695e1877214e9386ced5 (diff) | |
parent | e4bfa961ae40a5f55598d2ce183b9fa654b492d6 (diff) | |
download | mariadb-git-629830d9626472f8deab45e9e9125518b0a2b4d6.tar.gz |
Merge moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
into moonbone.local:/work/16377-4.1-after
-rw-r--r-- | mysql-test/r/cast.result | 2 | ||||
-rw-r--r-- | sql/item_cmpfunc.h | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 2538fbfd61d..68687670e17 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -192,7 +192,7 @@ cast("2001-1-1" as datetime) = "2001-01-01 00:00:00" 1 select cast("1:2:3" as TIME) = "1:02:03"; cast("1:2:3" as TIME) = "1:02:03" -1 +0 select cast(NULL as DATE); cast(NULL as DATE) NULL diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 08d9de6ffd6..68852b5a5f6 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -43,11 +43,8 @@ public: int set_compare_func(Item_bool_func2 *owner, Item_result type); inline int set_compare_func(Item_bool_func2 *owner_arg) { - 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)); + return set_compare_func(owner_arg, item_cmp_type((*a)->result_type(), + (*b)->result_type())); } inline int set_cmp_func(Item_bool_func2 *owner_arg, Item **a1, Item **a2, @@ -60,11 +57,9 @@ public: inline int set_cmp_func(Item_bool_func2 *owner_arg, Item **a1, Item **a2) { - 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)); + return set_cmp_func(owner_arg, a1, a2, + item_cmp_type((*a1)->result_type(), + (*a2)->result_type())); } inline int compare() { return (this->*func)(); } |