mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed LP bug #944782.
This bug in the function JOIN::drop_unused_derived_keys() could leave the internal structures for a materialized derived table in an inconsistent state. This led to a not quite correct EXPLAIN output when no additional key had been created to access the table. It also may lead to more serious consequences: so, the test case added with this fix caused a crash in mariadb-5.5.20.
This commit is contained in:
@@ -8712,8 +8712,13 @@ void JOIN::drop_unused_derived_keys()
|
||||
continue;
|
||||
if (table->max_keys > 1)
|
||||
table->use_index(tab->ref.key);
|
||||
if (table->s->keys && tab->ref.key >= 0)
|
||||
tab->ref.key= 0;
|
||||
if (table->s->keys)
|
||||
{
|
||||
if (tab->ref.key >= 0)
|
||||
tab->ref.key= 0;
|
||||
else
|
||||
table->s->keys= 0;
|
||||
}
|
||||
tab->keys= (key_map) (table->s->keys ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user