diff options
author | Monty <monty@mariadb.org> | 2020-05-15 14:20:43 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-05-15 15:10:58 +0300 |
commit | af784385b4a2b286000fa2c658e34283fe7bba60 (patch) | |
tree | bcd26d315b27dfa867291fa9d6c4828da3117fac /sql/field.cc | |
parent | 277aa85c9b42e2a7b778d196b307e45711ccc895 (diff) | |
download | mariadb-git-af784385b4a2b286000fa2c658e34283fe7bba60.tar.gz |
Fix for using uninitialized memory
MDEV-22073 MSAN use-of-uninitialized-value in
collect_statistics_for_table()
Other things:
innodb.analyze_table was changed to mainly test statistic
collection. Was discussed with Marko.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc index 0e8dd26445f..9ab76aa37a4 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7772,6 +7772,12 @@ my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value) } +void Field_varstring::mark_unused_memory_as_defined() +{ + uint used_length __attribute__((unused)) = get_length(); + MEM_MAKE_DEFINED(get_data() + used_length, field_length - used_length); +} + int Field_varstring::cmp_max(const uchar *a_ptr, const uchar *b_ptr, uint max_len) |