summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-07-21 23:38:30 +0400
committerAlexander Barkov <bar@mariadb.org>2017-07-21 23:38:30 +0400
commit23290e42e3f105c93745ac94ad6864ed29afe31b (patch)
tree9243ae94da39c042a707074ef52ca93aa1854092 /sql/sql_select.cc
parent34668e10b2e0636b5e784ae76f0c5cba5e4eb732 (diff)
parente2afdb1ee430cb9d030aeeedc85eb903cda5e5d1 (diff)
downloadmariadb-git-23290e42e3f105c93745ac94ad6864ed29afe31b.tar.gz
Merge commit 'e2afdb1ee430cb9d030aeeedc85eb903cda5e5d1' into bb-10.2-ext
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 29ca0491eba..210d0bbba9a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3405,8 +3405,14 @@ void JOIN::exec_inner()
if (zero_result_cause)
{
- if (select_lex->have_window_funcs())
+ if (select_lex->have_window_funcs() && send_row_on_empty_set())
{
+ /*
+ The query produces just one row but it has window functions.
+
+ The only way to compute the value of window function(s) is to
+ run the entire window function computation step (there is no shortcut).
+ */
const_tables= table_count;
first_select= sub_select_postjoin_aggr;
}