summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2017-05-03 13:49:43 -0700
committerIgor Babaev <igor@askmonty.org>2017-05-03 13:50:35 -0700
commitce8ee7d90b4f7dd784e1d7587093e671b35303f0 (patch)
treef09cb33337be80eaaffc00251a507e69e2c50fcf /sql/opt_sum.cc
parent52463ccff7ee5024f00541c12938ffbaf9b93958 (diff)
downloadmariadb-git-ce8ee7d90b4f7dd784e1d7587093e671b35303f0.tar.gz
Fixed the bug mdev-11990.
The usage of windows functions when all tables were optimized away by min/max optimization were not supported. As result a result, the queries that used window functions with min/max aggregation over the whole table returned wrong result sets. The patch fixed this problem.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index e7bf4658d5c..9bc21ab3ac3 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -461,7 +461,7 @@ int opt_sum_query(THD *thd,
{
if (recalc_const_item)
item->update_used_tables();
- if (!item->const_item())
+ if (!item->const_item() && item->type() != Item::WINDOW_FUNC_ITEM)
const_result= 0;
}
}