mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-16801 seg_fault on a query
The bug was in the in the code of JOIN::check_for_splittable_materialized() where the structures describing the fields of a materialized derived table that potentially could be used in split optimization were build. As a result of this bug some fields that were not usable for splitting were detected as usable. This could trigger crashes further in st_join_table::choose_best_splitting().
This commit is contained in:
@ -413,7 +413,8 @@ bool JOIN::check_for_splittable_materialized()
|
||||
|
||||
for (cand= cand_start; cand < cand_end; cand++)
|
||||
{
|
||||
if (cand->underlying_field->field_index + 1 == fldnr)
|
||||
if (cand->underlying_field->table == table &&
|
||||
cand->underlying_field->field_index + 1 == fldnr)
|
||||
{
|
||||
cand->is_usable_for_ref_access= true;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user