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.
This commit is contained in:
Igor Babaev 2010-12-24 14:36:35 -08:00
commit d9a81475c7
3 changed files with 80 additions and 2 deletions

View file

@ -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;