1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
This commit is contained in:
bell@sanja.is.com.ua
2002-12-10 11:45:40 +02:00
10 changed files with 576 additions and 180 deletions

View File

@ -791,6 +791,16 @@ JOIN::exec()
HA_POS_ERROR)))
DBUG_VOID_RETURN;
/*
We don't have to store rows in temp table that doesn't match HAVING if:
- we are sorting the table and writing complete group rows to the
temp table.
- We are using DISTINCT without resolving the distinct as a GROUP BY
on all columns.
If having is not handled here, it will be checked before the row
is sent to the client.
*/
if (having_list &&
(sort_and_group || (exec_tmp_table->distinct && !group_list)))
having=having_list;