1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-6830: Server crashes in best_access_path after a sequence of SELECTs ...

generate_derived_keys_for_table() did not work correctly in the case where
- it had a potential index on derived table
- however, TABLE::check_tmp_key() would disallow creation of this index 
  after looking at its future key parts (because of the key parts exceeding 
  max. index length)
- the code would leave a KEYUSE structure that refers to a non-existant index.
  Depending on further optimizer calculations, this could cause a crash.
This commit is contained in:
Sergey Petrunya
2014-12-18 20:06:49 +03:00
parent c9742ceac5
commit b75090c7de
4 changed files with 114 additions and 1 deletions

View File

@@ -9060,7 +9060,7 @@ bool generate_derived_keys_for_table(KEYUSE *keyuse, uint count, uint keys)
else
{
/* Mark keyuses for this key to be excluded */
for (KEYUSE *curr=save_first_keyuse; curr < first_keyuse; curr++)
for (KEYUSE *curr=save_first_keyuse; curr < keyuse; curr++)
{
curr->key= MAX_KEY;
}