summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc5
-rw-r--r--sql/item_subselect.cc13
2 files changed, 6 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 2b9a612da18..79295eb90b0 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -636,13 +636,12 @@ longlong Item_in_optimizer::val_int()
{
DBUG_ASSERT(fixed == 1);
cache->store(args[0]);
- longlong tmp= args[1]->val_int_result();
if (cache->null_value)
{
- if (tmp)
- null_value= 1;
+ null_value= 1;
return 0;
}
+ longlong tmp= args[1]->val_int_result();
null_value= args[1]->null_value;
return tmp;
}
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 16186b1a6d3..3a1e1918e55 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -825,8 +825,6 @@ Item_in_subselect::single_value_transformer(JOIN *join,
select_lex->ref_pointer_array,
(char *)"<ref>",
this->full_name()));
- if (!abort_on_null && left_expr->maybe_null)
- item= new Item_cond_or(new Item_func_isnull(left_expr), item);
/*
AND and comparison functions can't be changed during fix_fields()
we can assign select_lex->having here, and pass 0 as last
@@ -872,8 +870,6 @@ Item_in_subselect::single_value_transformer(JOIN *join,
select_lex->having_fix_field= 0;
item= new Item_cond_or(item,
new Item_func_isnull(orig_item));
- if (left_expr->maybe_null)
- item= new Item_cond_or(new Item_func_isnull(left_expr), item);
}
item->name= (char *)in_additional_cond;
/*
@@ -894,13 +890,12 @@ Item_in_subselect::single_value_transformer(JOIN *join,
we can assign select_lex->having here, and pass 0 as last
argument (reference) to fix_fields()
*/
- item= func->create(expr,
- new Item_null_helper(this, item,
+ select_lex->having=
+ join->having=
+ func->create(expr,
+ new Item_null_helper(this, item,
(char *)"<no matter>",
(char *)"<result>"));
- if (!abort_on_null && left_expr->maybe_null)
- item= new Item_cond_or(new Item_func_isnull(left_expr), item);
- select_lex->having= join->having= item;
select_lex->having_fix_field= 1;
if (join->having->fix_fields(thd, join->tables_list,
0))