[Commits] be8828fa10f: MDEV-17734: AddressSanitizer: use-after-poison in create_key_parts_for_pseudo_indexes
revision-id: be8828fa10fe52682c85f0ab2b3fba6842fd5bfd (mariadb-10.0.36-81-gbe8828fa10f) parent(s): f0db071ffeb1a6f3b8e048932c305f2c3e4a28bd author: Varun Gupta committer: Varun Gupta timestamp: 2018-11-20 18:27:31 +0530 message: 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. --- sql/opt_range.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3bcaa72e32f..a3943cbe3ff 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -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;
participants (1)
-
Varun