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.


configure.in:
  Updated version number
libmysqld/libmysqld.c:
  Portability fix (for windows)
mysql-test/r/func_group.result:
  Added test case for MIN/MAX problems
mysql-test/t/func_group.test:
  Added test case for MIN/MAX problems
sql/item.h:
  Fix for MIN/MAX with empty tables
sql/item_sum.h:
  Fix for MIN/MAX with empty tables
sql/opt_sum.cc:
  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.
sql/sql_select.cc:
  Fix for MIN/MAX with empty tables
This commit is contained in:
unknown 2003-02-03 20:20:32 +02:00
commit c73dcb5e30
8 changed files with 158 additions and 27 deletions

View file

@ -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();