mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-30651: Assertion `sel->quick' in make_range_rowid_filters
(Variant for 10.6: return error code from SQL_SELECT::test_quick_select) The optimizer deals with Rowid Filters this way: 1. First, range optimizer is invoked. It saves information about all potential range accesses. 2. A query plan is chosen. Suppose, it uses a Rowid Filter on index $IDX. 3. JOIN::make_range_rowid_filters() calls the range optimizer again to create a quick select on index $IDX which will be used to populate the rowid filter. The problem: KILL command catches the query in step #3. Quick Select is not created which causes a crash. Fixed by checking if query was killed.
This commit is contained in:
@@ -2720,7 +2720,10 @@ SQL_SELECT::test_quick_select(THD *thd,
|
||||
only_single_index_range_scan= 1;
|
||||
|
||||
if (head->force_index || force_quick_range)
|
||||
{
|
||||
DEBUG_SYNC(thd, "in_forced_range_optimize");
|
||||
scan_time= read_time= DBL_MAX;
|
||||
}
|
||||
else
|
||||
{
|
||||
scan_time= rows2double(records) / TIME_FOR_COMPARE;
|
||||
@@ -3117,6 +3120,12 @@ SQL_SELECT::test_quick_select(THD *thd,
|
||||
free_root(&alloc,MYF(0)); // Return memory & allocator
|
||||
thd->mem_root= param.old_root;
|
||||
thd->no_errors=0;
|
||||
if (thd->killed || thd->is_error())
|
||||
{
|
||||
delete quick;
|
||||
quick= NULL;
|
||||
returnval= ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
DBUG_EXECUTE("info", print_quick(quick, &needed_reg););
|
||||
|
Reference in New Issue
Block a user