diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-07-31 23:00:59 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-07-31 23:00:59 +0400 |
commit | c431eafd62bae41dd89a6b71e4554facbad1040b (patch) | |
tree | f8e64bee7cba1d3a70f88e57be85a23e890b16be /sql/sql_select.cc | |
parent | e67b816451cb1003fc42755e40327411fd8b7a35 (diff) | |
parent | c9218ff43989bf2385d1f62b45ed1f6229cbc5a5 (diff) | |
download | mariadb-git-c431eafd62bae41dd89a6b71e4554facbad1040b.tar.gz |
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 438c276c096..d27d4c943df 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; } |