Skip to content

Commit 14f6b0c

Browse files
author
Varun Gupta
committed
MDEV-17734: AddressSanitizer: use-after-poison in create_key_parts_for_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.
1 parent a84d87f commit 14f6b0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql/opt_range.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3350,7 +3350,9 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
33503350
if (bitmap_is_set(used_fields, (*field_ptr)->field_index))
33513351
{
33523352
Field *field= *field_ptr;
3353-
if (field->type() == MYSQL_TYPE_GEOMETRY)
3353+
Column_statistics* col_stats= field->read_stats;
3354+
if (field->type() == MYSQL_TYPE_GEOMETRY ||
3355+
!col_stats || col_stats->no_stat_values_provided())
33543356
continue;
33553357

33563358
uint16 store_length;

0 commit comments

Comments
 (0)