summaryrefslogtreecommitdiff
path: root/sql/opt_index_cond_pushdown.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-12-24 14:36:35 -0800
committerIgor Babaev <igor@askmonty.org>2010-12-24 14:36:35 -0800
commitd9a81475c70aebc1f2542bf0c115b3ebd9649193 (patch)
tree4a4bfc01d4a13e9c293415be57ee624edb44e7c6 /sql/opt_index_cond_pushdown.cc
parentf51a26885faa0106286e63fd15f18dae6f618508 (diff)
downloadmariadb-git-d9a81475c70aebc1f2542bf0c115b3ebd9649193.tar.gz
Fixed LP bug#694092.
In some cases the function make_cond_for_index() was mistaken when detecting index only pushdown conditions for a table: a pushdown condition that was not index only could be marked as such. It happened because the procedure erroneously used the markers for index only conditions that remained from the calls of this function that extracted the index conditions for other tables. Fixed by erasing index only markers as soon as they are need anymore.
Diffstat (limited to 'sql/opt_index_cond_pushdown.cc')
-rw-r--r--sql/opt_index_cond_pushdown.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc
index 6f0210a3d21..9f6cd69663d 100644
--- a/sql/opt_index_cond_pushdown.cc
+++ b/sql/opt_index_cond_pushdown.cc
@@ -155,7 +155,11 @@ Item *make_cond_for_index(Item *cond, TABLE *table, uint keyno,
new_cond->argument_list()->push_back(fix);
used_tables|= fix->used_tables();
}
- n_marked += test(item->marker == ICP_COND_USES_INDEX_ONLY);
+ if (test(item->marker == ICP_COND_USES_INDEX_ONLY))
+ {
+ n_marked++;
+ item->marker= 0;
+ }
}
if (n_marked ==((Item_cond*)cond)->argument_list()->elements)
cond->marker= ICP_COND_USES_INDEX_ONLY;
@@ -184,7 +188,11 @@ Item *make_cond_for_index(Item *cond, TABLE *table, uint keyno,
if (!fix)
return (COND*) 0;
new_cond->argument_list()->push_back(fix);
- n_marked += test(item->marker == ICP_COND_USES_INDEX_ONLY);
+ if (test(item->marker == ICP_COND_USES_INDEX_ONLY))
+ {
+ n_marked++;
+ item->marker= 0;
+ }
}
if (n_marked ==((Item_cond*)cond)->argument_list()->elements)
cond->marker= ICP_COND_USES_INDEX_ONLY;