summaryrefslogtreecommitdiff
path: root/sql/key.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2017-03-11 20:12:15 +0000
committerSergei Petrunia <psergey@askmonty.org>2017-03-11 20:12:15 +0000
commit5b30c7896e8514b29dba0909272cda49910243ae (patch)
tree9f4213363cb529795ae15fdb00b3e4f6ecd72ed5 /sql/key.cc
parent5c1c2f67ec9373f55f9b69bdaf4adad416e4788b (diff)
parenteded6243bc4796ab44e70403edd059d32225f589 (diff)
downloadmariadb-git-5b30c7896e8514b29dba0909272cda49910243ae.tar.gz
Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks
Diffstat (limited to 'sql/key.cc')
-rw-r--r--sql/key.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/sql/key.cc b/sql/key.cc
index 77660c0fc8c..0c931184da7 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -465,19 +465,8 @@ void key_unpack(String *to, TABLE *table, KEY *key)
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields)
{
- bitmap_clear_all(&table->tmp_set);
- table->mark_columns_used_by_index_no_reset(idx, &table->tmp_set);
- if (bitmap_is_overlapping(&table->tmp_set, fields))
- return 1;
-
- /*
- If table handler has primary key as part of the index, check that primary
- key is not updated
- */
- if (idx != table->s->primary_key && table->s->primary_key < MAX_KEY &&
- (table->file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX))
- return is_key_used(table, table->s->primary_key, fields);
- return 0;
+ table->mark_columns_used_by_index(idx, &table->tmp_set);
+ return bitmap_is_overlapping(&table->tmp_set, fields);
}