summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-11-18 18:10:07 +0200
committerunknown <bell@sanja.is.com.ua>2004-11-18 18:10:07 +0200
commit9438c2ca766a176d9b03ebdba466bef37c6e1b40 (patch)
treed831cff077b97eced161a50c24d8964c0a08a416 /sql/item_sum.h
parent3a301ac1f8466eee0941344729a9ba3521da36a7 (diff)
downloadmariadb-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.h')
-rw-r--r--sql/item_sum.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 5aa0d37190b..9993ce1bb12 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -403,19 +403,22 @@ class Item_sum_hybrid :public Item_sum
int cmp_sign;
table_map used_table_cache;
CHARSET_INFO *cmp_charset;
+ bool was_values; // was checked at least some values (for max/min only)
public:
Item_sum_hybrid(Item *item_par,int sign)
:Item_sum(item_par), sum(0.0), sum_int(0),
hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG),
cmp_sign(sign), used_table_cache(~(table_map) 0),
- cmp_charset(&my_charset_bin)
+ cmp_charset(&my_charset_bin), was_values(TRUE)
{}
Item_sum_hybrid(THD *thd, Item_sum_hybrid *item):
Item_sum(thd, item), value(item->value),
sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type),
hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign),
- used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {}
+ used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset),
+ was_values(TRUE)
+ {}
bool fix_fields(THD *, TABLE_LIST *, Item **);
table_map used_tables() const { return used_table_cache; }
bool const_item() const { return !used_table_cache; }
@@ -434,6 +437,8 @@ class Item_sum_hybrid :public Item_sum
void min_max_update_real_field();
void min_max_update_int_field();
void cleanup();
+ bool any_value() { return was_values; }
+ void no_rows_in_result();
};