1
0
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:
Igor Babaev
2018-08-03 14:54:02 -07:00
parent 7749745b7d
commit d453374fc4
3 changed files with 89 additions and 1 deletions

View File

@ -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;