1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed LP bug #878199.

The function JOIN::drop_unused_derived_keys could erroneously set
the value of REF::key to 0 for a joined materialized view/derived table
in the case when no REF access to the table was used by the query
execution plan. This could cause a crash of the server.
This commit is contained in:
Igor Babaev
2011-10-20 04:59:20 -07:00
parent 0e4d88f1b2
commit e7a7e2a036
3 changed files with 46 additions and 1 deletions

View File

@ -8541,7 +8541,7 @@ void JOIN::drop_unused_derived_keys()
continue;
if (table->max_keys > 1)
table->use_index(tab->ref.key);
if (table->s->keys)
if (table->s->keys && tab->ref.key >= 0)
tab->ref.key= 0;
tab->keys= (key_map) (table->s->keys ? 1 : 0);
}