summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2013-09-26 21:20:15 +0300
committerunknown <sanja@askmonty.org>2013-09-26 21:20:15 +0300
commite5746665c9f8dcfa66a7a645f1c5517769a2fa0a (patch)
tree56e9d83b5ef43f93d9628c25f69b81f174d48f5c /sql/item_cmpfunc.cc
parent828be0d9bae813d0587fbede6e02b12eebac66ca (diff)
parent9d83468e78ba23f024ce3c11443913ad75cf1ea5 (diff)
downloadmariadb-git-e5746665c9f8dcfa66a7a645f1c5517769a2fa0a.tar.gz
merge 10.0-base -> 10.0
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 256cae2e384..0fd5ee4048b 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;
@@ -1906,8 +1906,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()
@@ -2046,7 +2045,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();
@@ -2742,7 +2741,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;
@@ -4646,8 +4645,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;
}
}
@@ -4826,9 +4823,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();
}
@@ -5118,7 +5116,7 @@ Item_func_regex::fix_length_and_dec()
int comp_res= regcomp(TRUE);
if (comp_res == -1)
{ // Will always return NULL
- set_persist_maybe_null(1);
+ maybe_null= 1;
return;
}
else if (comp_res)
@@ -5127,7 +5125,7 @@ Item_func_regex::fix_length_and_dec()
maybe_null= args[0]->maybe_null;
}
else
- set_persist_maybe_null(1);
+ maybe_null=1;
}
@@ -6071,8 +6069,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;
}
}