1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-37292 Hint NO_INDEX() disables all indexes if none of given index names is resolved

When a hint has a list of index names, for example,
  `NO_INDEX(t1 idx1, idx2)`
there is a possibility that some or all of the listed index names will
not be resolved. If none of them are resolved, the hint becomes a table-level
hint, for example, `NO_INDEX(t1)`, which erroneously disables all indexes
of `t1` instead of disabling only some of them.

This commit addresses this issue by adding an additional check: a hint
containing a list of index names is considered resolved only when at least one
of the listed names is resolved successfully.
This commit is contained in:
Oleg Smirnov
2025-07-26 21:00:23 +07:00
committed by Sergei Golubchik
parent c329c43be7
commit 893761b35c
6 changed files with 175 additions and 9 deletions

View File

@@ -648,10 +648,12 @@ public:
void set_fixed() { fixed= true; }
bool is_fixed() const { return fixed; }
bool is_table_level() const { return parsed_hint->is_table_level_hint(); }
void set_key_map(uint i) { key_map.set_bit(i); }
bool is_set_key_map(uint i) { return key_map.is_set(i); }
bool is_key_map_clear_all() { return key_map.is_clear_all(); }
uint bits_set() { return key_map.bits_set(); }
Key_map *get_key_map() { return &key_map; }
};