summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2018-07-24 23:45:55 -0700
committerIgor Babaev <igor@askmonty.org>2018-07-24 23:53:12 -0700
commit1fde449f1d4e8ebe12e989754bfdc84b123cf0b2 (patch)
tree34c15aa81a621c51029cb0145ea31c208d578287 /sql/item.h
parent57cde8ccd19675dc98e3cbacf0ef5c72cb188e49 (diff)
downloadmariadb-git-1fde449f1d4e8ebe12e989754bfdc84b123cf0b2.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 139ce40b25b..dcd773ffc59 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1449,6 +1449,11 @@ public:
virtual bool exists2in_processor(uchar *opt_arg) { return 0; }
virtual bool find_selective_predicates_list_processor(uchar *opt_arg)
{ return 0; }
+ bool cleanup_is_expensive_cache_processor(uchar *arg)
+ {
+ is_expensive_cache= (int8)(-1);
+ return 0;
+ }
/* To call bool function for all arguments */
struct bool_func_call_args