From 29f9e679adc90adf5d3c6e08da947789c9c2ac8b Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 14 Aug 2019 23:46:47 +0300 Subject: Don't copy uninitialized bytes when copying varstrings When using field_conv(), which is called in case of field1=field2 copy in fill_records(), full varstring's was copied, including unitialized bytes. This caused valgrind to compilain about usage of unitialized bytes when using Aria static length records. Fixed by not using memcpy when copying varstrings but instead just copy the real bytes. --- sql/field.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sql/field.h') diff --git a/sql/field.h b/sql/field.h index db78efe0754..34d6684571b 100644 --- a/sql/field.h +++ b/sql/field.h @@ -3463,12 +3463,7 @@ public: length_bytes : 0); } Copy_func *get_copy_func(const Field *from) const; - bool memcpy_field_possible(const Field *from) const - { - return Field_str::memcpy_field_possible(from) && - !compression_method() == !from->compression_method() && - length_bytes == ((Field_varstring*) from)->length_bytes; - } + bool memcpy_field_possible(const Field *from) const; int store(const char *to,size_t length,CHARSET_INFO *charset); using Field_str::store; #ifdef HAVE_valgrind_or_MSAN -- cgit v1.2.1