diff options
author | unknown <bell@sanja.is.com.ua> | 2004-11-18 18:10:07 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-11-18 18:10:07 +0200 |
commit | 9438c2ca766a176d9b03ebdba466bef37c6e1b40 (patch) | |
tree | d831cff077b97eced161a50c24d8964c0a08a416 /sql/item_sum.cc | |
parent | 3a301ac1f8466eee0941344729a9ba3521da36a7 (diff) | |
download | mariadb-git-9438c2ca766a176d9b03ebdba466bef37c6e1b40.tar.gz |
reporting empty result added in case of max/min optimisation of ALL/ANY/SOME subqueries
fixed null processing in NOT operation used in ALL subquery (Bug #6247)
mysql-test/r/subselect.result:
new tests of ALL/ANY wiews
mysql-test/t/subselect.test:
new tests of ALL/ANY wiews
sql/item_cmpfunc.cc:
fixed special NOT ALL processing
fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries
sql/item_cmpfunc.h:
fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries
sql/item_subselect.cc:
reporting empty result added for max/min subqueries
sql/item_subselect.h:
reporting empty result added for max/min subqueries
sql/item_sum.cc:
reporting empty result added fox max/min aggregate functions
sql/item_sum.h:
reporting empty result added fox max/min aggregate functions
sql/sql_class.cc:
reporting empty result added for max/min subqueries
sql/sql_parse.cc:
reporting empty result added for max/min subqueries
sql/sql_union.cc:
reporting empty result added for max/min subqueries
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3b3a6083725..cf07e136034 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -540,9 +540,22 @@ void Item_sum_hybrid::cleanup() DBUG_ENTER("Item_sum_hybrid::cleanup"); Item_sum::cleanup(); used_table_cache= ~(table_map) 0; + /* + by default is is TRUE to avoid TRUE reporting by + Item_func_not_all/Item_func_nop_all if this item was never called. + + no_rows_in_result() set it to FALSE if was not results found. + */ + was_values= TRUE; DBUG_VOID_RETURN; } +void Item_sum_hybrid::no_rows_in_result() +{ + Item_sum::no_rows_in_result(); + was_values= FALSE; +} + Item *Item_sum_min::copy_or_same(THD* thd) { |