diff options
author | unknown <sanja@askmonty.org> | 2013-09-25 21:07:06 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2013-09-25 21:07:06 +0300 |
commit | 9d83468e78ba23f024ce3c11443913ad75cf1ea5 (patch) | |
tree | 0cef7fa6a3fd2e47fe22d105b2b8bbfe1b5a03e0 /sql/item_cmpfunc.cc | |
parent | 2fe0836eed16ce5809c34064893681f12c77da9f (diff) | |
parent | 64d6d8334fa63a0faa6d91ded21eca8e3871c7ec (diff) | |
download | mariadb-git-9d83468e78ba23f024ce3c11443913ad75cf1ea5.tar.gz |
merge 5.5 -> 10.0-base
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ffbe06e6c8f..676e80ae79b 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(); } @@ -5132,7 +5130,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; } @@ -5142,7 +5140,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; } @@ -6088,8 +6086,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; } } |