diff options
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 0b4789a4f35..6f975541c55 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4748,6 +4748,8 @@ Item *and_expressions(Item *a, Item *b, Item **org_item) longlong Item_func_isnull::val_int() { DBUG_ASSERT(fixed == 1); + if (const_item() && !args[0]->maybe_null) + return 0; return args[0]->is_null() ? 1: 0; } @@ -4755,6 +4757,8 @@ longlong Item_is_not_null_test::val_int() { DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_is_not_null_test::val_int"); + if (const_item() && !args[0]->maybe_null) + DBUG_RETURN(1); if (args[0]->is_null()) { DBUG_PRINT("info", ("null")); |