From 9cd6e7ad73554be6d0186a42f983777a90a984f1 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 14 May 2019 14:01:15 +0200 Subject: MDEV-16932: ASAN heap-use-after-free in my_charlen_utf8 / my_well_formed_char_length_utf8 on 2nd execution of SP with ALTER trying to add bad CHECK Make automatic name generation during execution (not prepare). Check result of memory allocation operation. --- sql/field.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/field.h') diff --git a/sql/field.h b/sql/field.h index b9eb2085f0b..ac7794081bc 100644 --- a/sql/field.h +++ b/sql/field.h @@ -628,6 +628,7 @@ public: /* Flag indicating that the field is physically stored in the database */ bool stored_in_db; bool utf8; /* Already in utf8 */ + bool automatic_name; Item *expr; LEX_STRING name; /* Name of constraint */ /* see VCOL_* (VCOL_FIELD_REF, ...) */ @@ -637,7 +638,7 @@ public: : vcol_type((enum_vcol_info_type)VCOL_TYPE_NONE), field_type((enum enum_field_types)MYSQL_TYPE_VIRTUAL), in_partitioning_expr(FALSE), stored_in_db(FALSE), - utf8(TRUE), expr(NULL), flags(0) + utf8(TRUE), automatic_name(FALSE), expr(NULL), flags(0) { name.str= NULL; name.length= 0; -- cgit v1.2.1