mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#882994: Crash in QUICK_RANGE_SELECT::reset with derived_with_keys
- The bug was caused by the following scenario: = a quick select is created with get_quick_select_for_ref. The quick select refers to temporary (derived) table. It saves table->file, which refers to a ha_heap object. = When temp table is populated, ha_heap reaches max. size and is converted to a ha_myisam. However, quick->file remains pointing to where ha_heap was. = Attempt to use the quick select causes crash. - Fixed by introducing QUICK_SELECT_I::replace_handler(). Note that it will not work for index_merge quick selects. Which is fine, because these quick selects are never created for derived tables.
This commit is contained in:
@ -9701,6 +9701,8 @@ bool JOIN_TAB::preread_init()
|
||||
derived, DT_CREATE | DT_FILL))
|
||||
return TRUE;
|
||||
preread_init_done= TRUE;
|
||||
if (select && select->quick)
|
||||
select->quick->replace_handler(table->file);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user