From 5e61e1716e763315009318081fba5994b8910242 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 16 Apr 2018 16:59:19 -0700 Subject: MDEV-14515 ifnull result depends on number of rows in joined table Any expensive WHERE condition for a table-less query with implicit aggregation was lost. As a result the used aggregate functions were calculated over a non-empty set of rows even in the case when the condition was false. --- sql/opt_subselect.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/opt_subselect.cc') diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index c21541c4b97..1bda84bacd7 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -5903,5 +5903,6 @@ bool JOIN::choose_tableless_subquery_plan() tmp_having= having; } } + exec_const_cond= conds; return FALSE; } -- cgit v1.2.1