diff options
author | Igor Babaev <igor@askmonty.org> | 2010-11-10 14:34:37 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-11-10 14:34:37 -0800 |
commit | 24f6a2ec4b7132123ec08b6f9b7291e3b1eb9b4a (patch) | |
tree | 235e621958c59b6d4899732953de0eb32894129d /sql/opt_index_cond_pushdown.cc | |
parent | 6e5bcca7935d3c62f84bb640e5357664a210ee12 (diff) | |
parent | 74d18e93c6a620460fb2f75af11056739fea8f6b (diff) | |
download | mariadb-git-24f6a2ec4b7132123ec08b6f9b7291e3b1eb9b4a.tar.gz |
Merge
Diffstat (limited to 'sql/opt_index_cond_pushdown.cc')
-rw-r--r-- | sql/opt_index_cond_pushdown.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc index f6437e04ec5..71eadfb45cf 100644 --- a/sql/opt_index_cond_pushdown.cc +++ b/sql/opt_index_cond_pushdown.cc @@ -272,12 +272,14 @@ Item *make_cond_remainder(Item *cond, bool exclude_index) in tab->select_cond keyno Index for which extract and push the condition other_tbls_ok TRUE <=> Fields of other non-const tables are allowed + factor_out TRUE <=> Factor out the extracted condition DESCRIPTION Try to extract and push the index condition down to table handler */ -void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok) +void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok, + bool factor_out) { DBUG_ENTER("push_index_cond"); Item *idx_cond; @@ -350,7 +352,8 @@ void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok) if (idx_remainder_cond != idx_cond) tab->ref.disable_cache= TRUE; - Item *row_cond= make_cond_remainder(tab->select_cond, TRUE); + Item *row_cond= factor_out ? make_cond_remainder(tab->select_cond, TRUE) : + tab->pre_idx_push_select_cond; DBUG_EXECUTE("where", print_where(row_cond, "remainder cond", QT_ORDINARY);); |