summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2002-12-07 16:00:39 +0200
committerbell@sanja.is.com.ua <>2002-12-07 16:00:39 +0200
commitb1beb31400540e16f3294e18e7f664c641093dbc (patch)
tree589392bd88299b6d6ae1605cf6808499e8bbcb7c /sql/sql_select.cc
parented8cc2a844738386ae3eef3b3b01c0e784a0b3f6 (diff)
downloadmariadb-git-b1beb31400540e16f3294e18e7f664c641093dbc.tar.gz
Row item fixing (SCRUM related)
Inserted comment
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 50820b931b6..4e9f8cf9383 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -763,6 +763,16 @@ JOIN::exec()
select_options, unit)))
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;