summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-02-03 20:20:32 +0200
committermonty@mashka.mysql.fi <>2003-02-03 20:20:32 +0200
commite3cd63521cd68743393b35c0056faf3e9388ca1c (patch)
tree9969b64873b025006c1eb0dba4dddc67e5501c19 /sql/item_sum.h
parentc42e94a6e690e1fbea887f2e2ed95b0e2ae97607 (diff)
downloadmariadb-git-e3cd63521cd68743393b35c0056faf3e9388ca1c.tar.gz
Fix for MIN/MAX with empty tables
MIN(key_column) could in some cases return NULL on a column with NULL and other values. MIN(key_column) and MAX(key_column) could in some cases return wrong values when used in OUTER JOIN.
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 2cf92343ebb..04f95dfd778 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -69,6 +69,7 @@ public:
void make_field(Send_field *field);
void print(String *str);
void fix_num_length_and_dec();
+ void no_rows_in_result() { reset(); }
virtual bool setup(THD *thd) {return 0;}
unsigned int size_of() { return sizeof(*this);}
};
@@ -135,6 +136,7 @@ class Item_sum_count :public Item_sum_int
bool const_item() const { return !used_table_cache; }
enum Sumfunctype sum_func () const { return COUNT_FUNC; }
void reset();
+ void no_rows_in_result() { count=0; }
bool add();
void make_const(longlong count_arg) { count=count_arg; used_table_cache=0; }
longlong val_int();