mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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.
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user