summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-05-15 14:20:43 +0300
committerMonty <monty@mariadb.org>2020-05-15 15:10:58 +0300
commitaf784385b4a2b286000fa2c658e34283fe7bba60 (patch)
treebcd26d315b27dfa867291fa9d6c4828da3117fac /sql/field.cc
parent277aa85c9b42e2a7b778d196b307e45711ccc895 (diff)
downloadmariadb-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.cc6
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)