mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-28285 Unexpected result when combining DISTINCT, subselect and LIMIT
The problem was that when JOIN_TAB::remove_duplicates() noticed there can only be one possible row in the output, it adjusted limits but didn't take into account any possible offset. Fixed by not adjusting limit offset when setting one-row-limit.
This commit is contained in:
@ -24640,7 +24640,7 @@ JOIN_TAB::remove_duplicates()
|
||||
!(join->select_options & OPTION_FOUND_ROWS))
|
||||
{
|
||||
// only const items with no OPTION_FOUND_ROWS
|
||||
join->unit->lim.set_single_row(); // Only send first row
|
||||
join->unit->lim.send_first_row(); // Only send first row
|
||||
my_free(sortorder);
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user