summaryrefslogtreecommitdiff
path: root/sql
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
parentc97ae6b56f294690ec4c5d5795503c0725b0ce02 (diff)
parent99992f6ec4600222fc4312f62287b1a42155ea4c (diff)
downloadmariadb-git-5d5f3a1ee8f4d05cfa4418624d185fb3d9a0cab8.tar.gz
Merge 5.3->5.5
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc4
-rw-r--r--sql/sql_select.cc4
2 files changed, 6 insertions, 2 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"));
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b6b56bc49f2..bdede4e831b 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -13748,7 +13748,7 @@ internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
Propagate the newly formed multiple equalities to
the all AND/OR levels of cond
*/
- bool is_simplifiable_cond= true;
+ bool is_simplifiable_cond= false;
propagate_new_equalities(thd, cond, cond_equalities,
cond_equal->upper_levels,
&is_simplifiable_cond);
@@ -13759,7 +13759,7 @@ internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
*/
if (is_simplifiable_cond)
{
- if (!(cond= remove_eq_conds(thd, cond, cond_value)))
+ if (!(cond= internal_remove_eq_conds(thd, cond, cond_value)))
return cond;
}
}