From 0ba4b082febaf9bb72e2a1f741d6206f92f26a79 Mon Sep 17 00:00:00 2001 From: "igor@rurik.mysql.com" <> Date: Tue, 2 Dec 2003 14:33:42 -0800 Subject: [PATCH] sql_select.cc: Fixed a problem a with special cases of IS NULL usage caused by some erroneous change made when Item_equal was introduced. --- sql/sql_select.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 748e2c38cf3..55f5b28fc78 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5152,8 +5152,7 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) } } else if (cond->type() == Item::FUNC_ITEM && - ((Item_func*) cond)->functype() == Item_func::ISNULL_FUNC && - !cond->const_item()) + ((Item_func*) cond)->functype() == Item_func::ISNULL_FUNC) { /* Handles this special case for some ODBC applications: @@ -5203,6 +5202,11 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) } } } + if (cond->const_item()) + { + *cond_value= eval_const_cond(cond) ? Item::COND_TRUE : Item::COND_FALSE; + return (COND*) 0; + } } else if (cond->type() == Item::FUNC_ITEM && ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)