summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-02-03 20:20:32 +0200
committerunknown <monty@mashka.mysql.fi>2003-02-03 20:20:32 +0200
commitc73dcb5e3018374e8c1a8ae57b32483cb4f62be4 (patch)
tree9969b64873b025006c1eb0dba4dddc67e5501c19 /sql/sql_select.cc
parentac4dacaa29f8f7ee2b5ed7c56815ee343d4b8d82 (diff)
downloadmariadb-git-c73dcb5e3018374e8c1a8ae57b32483cb4f62be4.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. 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
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 6996bba8798..be5e5be7cb7 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3104,7 +3104,13 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
if (!(result->send_fields(fields,1)))
{
if (send_row)
+ {
+ List_iterator_fast<Item> it(fields);
+ Item *item;
+ while ((item= it++))
+ item->no_rows_in_result();
result->send_data(fields);
+ }
if (tables) // Not from do_select()
{
/* Close open cursors */