diff options
author | Monty <monty@mariadb.org> | 2021-05-11 14:09:45 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-05-19 22:54:14 +0200 |
commit | 0c7b0189442b1704a2eaf33f1c264d94ac2272ed (patch) | |
tree | 1335591828a38cec3d6e2bc77678a68d09c45128 | |
parent | acf282c36b9edad67846675ba36665ab8e25a41f (diff) | |
download | mariadb-git-0c7b0189442b1704a2eaf33f1c264d94ac2272ed.tar.gz |
Remove not used IPC_COND_USED_INDEX
-rw-r--r-- | sql/opt_index_cond_pushdown.cc | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc index e950ad1b7ca..6a24fa95b68 100644 --- a/sql/opt_index_cond_pushdown.cc +++ b/sql/opt_index_cond_pushdown.cc @@ -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 @@ -173,8 +172,8 @@ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno, Example: make_cond_for_index( - "cond(t1.field) AND cond(t2.key1) AND cond(t2.non_key) AND cond(t2.key2)", - t2, keyno(t2.key1)) + "cond(t1.field) AND cond(t2.key1) AND cond(t2.non_key) AND cond(t2.key2)", + t2, keyno(t2.key1)) will return "cond(t1.field) AND cond(t2.key2)" @@ -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; } |