mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-14440: Assertion `inited==RND' failed in handler::ha_rnd_end
In the function QUICK_RANGE_SELECT::init_ror_merged_scan we create a seperate handler if the handler in
head->file cannot be reused. The flag free_file tells us if we have a seperate handler or not.
There are cases where you might create a handler and then there might be a failure(running ALTER)
and then we have to revert the handler back to the original one. The code does that
but it does not reset the flag 'free_file' in this case.
Also backported f2c418079d
.
This commit is contained in:
@ -2161,6 +2161,7 @@ failure:
|
||||
head->column_bitmaps_set(save_read_set, save_write_set);
|
||||
delete file;
|
||||
file= save_file;
|
||||
free_file= false;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
@ -7140,6 +7141,8 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
|
||||
if (ror_intersect_add(intersect, cpk_scan, TRUE) &&
|
||||
(intersect->total_cost < min_cost))
|
||||
intersect_best= intersect; //just set pointer here
|
||||
else
|
||||
cpk_scan= 0; // Don't use cpk_scan
|
||||
}
|
||||
else
|
||||
cpk_scan= 0; // Don't use cpk_scan
|
||||
|
Reference in New Issue
Block a user