Skip to content

Commit

Permalink
MDEV-17734: AddressSanitizer: use-after-poison in create_key_parts_fo…
Browse files Browse the repository at this point in the history
…r_pseudo_indexes

In this case we were trying to access memory for key_parts which we did not
assign for a fields because it did not any EITS statistics.
The check if EITS statistics for a column is avaialable or not was missing.
  • Loading branch information
Varun Gupta committed Nov 20, 2018
1 parent a84d87f commit 14f6b0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sql/opt_range.cc
Expand Up @@ -3350,7 +3350,9 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
if (bitmap_is_set(used_fields, (*field_ptr)->field_index))
{
Field *field= *field_ptr;
if (field->type() == MYSQL_TYPE_GEOMETRY)
Column_statistics* col_stats= field->read_stats;
if (field->type() == MYSQL_TYPE_GEOMETRY ||
!col_stats || col_stats->no_stat_values_provided())
continue;

uint16 store_length;
Expand Down

0 comments on commit 14f6b0c

Please sign in to comment.