summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2017-05-15 09:51:01 -0700
committerIgor Babaev <igor@askmonty.org>2017-05-15 10:00:00 -0700
commite0352fb07961f09ff6481136dc22f3c0db376def (patch)
treea4e7d7869e90fe9a404b5e111e3f534b198792ef /sql/item_sum.h
parent9495e018fbd88d094a71cb054cf468c31ebd6957 (diff)
downloadmariadb-git-e0352fb07961f09ff6481136dc22f3c0db376def.tar.gz
Fixed the bug mdev-7599.
At some conditions the function opt_sum_query() can apply MIN/MAX optimizations to to Item_sum objects of a select These optimizations becomes invalid if this select is the subquery of an IN subquery predicate that is converted to a EXISTS subquery. Thus in this case the MIX/MAX optimizations that have been applied in opt_sum_query() must be rolled back. This bug appeared in 5.3 when the code for the cost base choice between materialization and in-to-exists transformation of non-correlated IN subqueries was introduced. Before this code in-to-exists transformations were always performed before the call of opt_sum_query().
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 86093f5d4f5..dcc3e494f82 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -454,6 +454,7 @@ public:
used_tables_cache= 0;
forced_const= TRUE;
}
+ void reset_forced_const() { forced_const= FALSE; }
virtual bool const_item() const { return forced_const; }
virtual bool const_during_execution() const { return false; }
virtual void print(String *str, enum_query_type query_type);