diff options
author | Igor Babaev <igor@askmonty.org> | 2011-12-18 23:38:37 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-12-18 23:38:37 -0800 |
commit | 7a1406f229df002befeb91f39f57e15444aecb21 (patch) | |
tree | 42a7ecb4198e90a067b21f4cede12cc08dea28c5 /sql | |
parent | 2bfd02cea95a774dbc82b51fafa2bf727b9bb0ff (diff) | |
download | mariadb-git-7a1406f229df002befeb91f39f57e15444aecb21.tar.gz |
Fixed LP bug #904832.
Do not perform index condition pushdown for conditions containing subqueries
and stored functions.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.h | 4 | ||||
-rw-r--r-- | sql/item_func.h | 4 | ||||
-rw-r--r-- | sql/item_subselect.h | 4 | ||||
-rw-r--r-- | sql/opt_index_cond_pushdown.cc | 5 |
4 files changed, 17 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h index fb6421c23b2..d9aa6f3497e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1024,6 +1024,10 @@ public: virtual bool eval_not_null_tables(uchar *opt_arg) { return 0; } virtual bool clear_sum_processor(uchar *opt_arg) { return 0; } virtual bool is_subquery_processor (uchar *opt_arg) { return 0; } + virtual bool limit_index_condition_pushdown_processor(uchar *opt_arg) + { + return FALSE; + } /* To call bool function for all arguments */ struct bool_func_call_args diff --git a/sql/item_func.h b/sql/item_func.h index bf4dd240253..54635bf21f7 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1870,6 +1870,10 @@ public: { return trace_unsupported_by_check_vcol_func_processor(func_name()); } + bool limit_index_condition_pushdown_processor(uchar *opt_arg) + { + return TRUE; + } }; diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 60ca851c881..79044ccf3f7 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -229,6 +229,10 @@ public: virtual bool expr_cache_is_needed(THD *); virtual void get_cache_parameters(List<Item> ¶meters); virtual bool is_subquery_processor (uchar *opt_arg) { return 1; } + bool limit_index_condition_pushdown_processor(uchar *opt_arg) + { + return TRUE; + } friend class select_result_interceptor; friend class Item_in_optimizer; diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc index 3a9c813b93c..5240267b4ac 100644 --- a/sql/opt_index_cond_pushdown.cc +++ b/sql/opt_index_cond_pushdown.cc @@ -29,6 +29,11 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno, bool other_tbls_ok) { + if (item->walk(&Item::limit_index_condition_pushdown_processor, FALSE, NULL)) + { + return FALSE; + } + if (item->const_item()) return TRUE; |