diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.h | 5 | ||||
-rw-r--r-- | sql/sql_select.cc | 7 |
2 files changed, 12 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 diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e3b725ce1f6..460a64e1a7a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1212,6 +1212,13 @@ JOIN::optimize_inner() if (optimize_constant_subqueries()) DBUG_RETURN(1); + if (conds && conds->has_subquery()) + (void) conds->walk(&Item::cleanup_is_expensive_cache_processor, + 0, (uchar*)0); + if (having && having->has_subquery()) + (void) having->walk(&Item::cleanup_is_expensive_cache_processor, + 0, (uchar*)0); + if (setup_jtbm_semi_joins(this, join_list, &conds)) DBUG_RETURN(1); |