summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2013-09-25 17:16:13 +0300
committerunknown <sanja@askmonty.org>2013-09-25 17:16:13 +0300
commit64d6d8334fa63a0faa6d91ded21eca8e3871c7ec (patch)
treec313ec7d9f9db0c90649df5297e2d39230986291 /sql/item_cmpfunc.cc
parent72dffd878e47e4fcfd224cadfea06caed0ac956b (diff)
parentec7da1561e028aac40dee69433113978c982ce84 (diff)
downloadmariadb-git-64d6d8334fa63a0faa6d91ded21eca8e3871c7ec.tar.gz
merge 5.3 -> 5.5
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc20
1 files changed, 8 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 3760652d482..3d1bb6ce885 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1354,7 +1354,7 @@ int Arg_comparator::compare_e_row()
void Item_func_truth::fix_length_and_dec()
{
- set_persist_maybe_null(0);
+ maybe_null= 0;
null_value= 0;
decimals= 0;
max_length= 1;
@@ -1866,8 +1866,7 @@ longlong Item_func_eq::val_int()
void Item_func_equal::fix_length_and_dec()
{
Item_bool_func2::fix_length_and_dec();
- set_persist_maybe_null(0);
- null_value= 0;
+ maybe_null=null_value=0;
}
longlong Item_func_equal::val_int()
@@ -2006,7 +2005,7 @@ void Item_func_interval::fix_length_and_dec()
}
}
}
- set_persist_maybe_null(0);
+ maybe_null= 0;
max_length= 2;
used_tables_cache|= row->used_tables();
not_null_tables_cache= row->not_null_tables();
@@ -2702,7 +2701,7 @@ void
Item_func_nullif::fix_length_and_dec()
{
Item_bool_func2::fix_length_and_dec();
- set_persist_maybe_null(1);
+ maybe_null=1;
if (args[0]) // Only false if EOM
{
max_length=args[0]->max_length;
@@ -4596,8 +4595,6 @@ void Item_cond::update_used_tables()
item->update_used_tables();
used_tables_cache|= item->used_tables();
const_item_cache&= item->const_item();
- if (!persistent_maybe_null && item->maybe_null)
- maybe_null= 1;
}
}
@@ -4776,9 +4773,10 @@ longlong Item_is_not_null_test::val_int()
*/
void Item_is_not_null_test::update_used_tables()
{
- args[0]->update_used_tables();
if (!args[0]->maybe_null)
used_tables_cache= 0; /* is always true */
+ else
+ args[0]->update_used_tables();
}
@@ -5059,7 +5057,7 @@ Item_func_regex::fix_fields(THD *thd, Item **ref)
int comp_res= regcomp(TRUE);
if (comp_res == -1)
{ // Will always return NULL
- set_persist_maybe_null(1);
+ maybe_null=1;
fixed= 1;
return FALSE;
}
@@ -5069,7 +5067,7 @@ Item_func_regex::fix_fields(THD *thd, Item **ref)
maybe_null= args[0]->maybe_null;
}
else
- set_persist_maybe_null(1);
+ maybe_null=1;
fixed= 1;
return FALSE;
}
@@ -5998,8 +5996,6 @@ void Item_equal::update_used_tables()
used_tables_cache|= item->used_tables();
/* see commentary at Item_equal::update_const() */
const_item_cache&= item->const_item() && !item->is_outer_field();
- if (!persistent_maybe_null && item->maybe_null)
- maybe_null= 1;
}
}