summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-08-21 11:27:02 -0700
committerIgor Babaev <igor@askmonty.org>2013-08-21 11:27:02 -0700
commit5d5f3a1ee8f4d05cfa4418624d185fb3d9a0cab8 (patch)
tree6e47273ecbd6ce978cd857c28abe6e6f9f31ee5b /sql/item_cmpfunc.cc
parentc97ae6b56f294690ec4c5d5795503c0725b0ce02 (diff)
parent99992f6ec4600222fc4312f62287b1a42155ea4c (diff)
downloadmariadb-git-5d5f3a1ee8f4d05cfa4418624d185fb3d9a0cab8.tar.gz
Merge 5.3->5.5
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc4
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"));