summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2018-07-25 11:57:57 -0700
committerIgor Babaev <igor@askmonty.org>2018-07-25 11:58:19 -0700
commitaad70e9b4cdd719c3f7a559764e37ba7eea7bc3e (patch)
tree9335217f794275a03101aeedf668044c5599a0c6 /sql/item.h
parentde85355436e483902e0fff432348bc16f9ec1557 (diff)
downloadmariadb-git-aad70e9b4cdd719c3f7a559764e37ba7eea7bc3e.tar.gz
MDEV-16820 Lost 'Impossible where' from query with inexpensive subquery
This patch fixes another problem introduced by the patch for mdev-4817. The latter changed Item_cond::fix_fields() in such a way that it could call the virtual method is_expensive(). With the first its call the method saves the result in Item::is_expensive_cache. For all next calls the method returns the result from this cache. So if the item once was determined as expensive the method always returns true. For subqueries it's not good, because non-optimized subqueries always is considered as expensive. It means that the cache should be invalidated after the call of optimize_constant_subqueries().
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index ce07f993dc4..8fad8dadf22 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1614,6 +1614,11 @@ public:
virtual bool limit_index_condition_pushdown_processor(void *arg) { return 0; }
virtual bool exists2in_processor(void *arg) { return 0; }
virtual bool find_selective_predicates_list_processor(void *arg) { return 0; }
+ bool cleanup_is_expensive_cache_processor(void *arg)
+ {
+ is_expensive_cache= (int8)(-1);
+ return 0;
+ }
/*
TRUE if the expression depends only on the table indicated by tab_map