mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge with 4.0 to get fix for MIN/MAX
This commit is contained in:
@ -4981,6 +4981,11 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
|
||||
{
|
||||
if ((error=(*join_tab->next_select)(join,join_tab+1,0)) < 0)
|
||||
return error;
|
||||
/*
|
||||
Test if this was a SELECT DISTINCT query on a table that
|
||||
was not in the field list; In this case we can abort if
|
||||
we found a row, as no new rows can be added to the result.
|
||||
*/
|
||||
if (not_used_in_distinct && found_records != join->found_records)
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user