Commit 0c7b0189 authored by Monty's avatar Monty Committed by Sergei Golubchik

Remove not used IPC_COND_USED_INDEX

parent acf282c3
......@@ -152,7 +152,6 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
}
}
#define ICP_COND_USES_INDEX_ONLY 10
/*
Get a part of the condition that can be checked using only index fields
......@@ -161,8 +160,8 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
make_cond_for_index()
cond The source condition
table The table that is partially available
keyno The index in the above table. Only fields covered by the index
are available
keyno The index in the above table. Only fields covered by the
index are available
other_tbls_ok TRUE <=> Fields of other non-const tables are allowed
DESCRIPTION
......@@ -189,7 +188,6 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
return cond;
if (cond->type() == Item::COND_ITEM)
{
uint n_marked= 0;
if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC)
{
table_map used_tables= 0;
......@@ -206,14 +204,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
new_cond->argument_list()->push_back(fix, thd->mem_root);
used_tables|= fix->used_tables();
}
if (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;
switch (new_cond->argument_list()->elements) {
case 0:
return (COND*) 0;
......@@ -239,14 +230,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
if (!fix)
return (COND*) 0;
new_cond->argument_list()->push_back(fix, thd->mem_root);
if (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;
new_cond->quick_fix_field();
new_cond->used_tables_cache= ((Item_cond_or*) cond)->used_tables_cache;
new_cond->top_level_item();
......@@ -256,7 +240,6 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno,
if (!uses_index_fields_only(cond, table, keyno, other_tbls_ok))
return (COND*) 0;
cond->marker= ICP_COND_USES_INDEX_ONLY;
return cond;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment