diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 77adc6db59a..ea7b8325af2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -8375,7 +8375,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, } bool has_alias_ptr= alias != nullptr; - void *memregion= thd->calloc(sizeof(TABLE_LIST)); + void *memregion= thd->alloc(sizeof(TABLE_LIST)); TABLE_LIST *ptr= new (memregion) TABLE_LIST(thd, db, fqtn, alias_str, has_alias_ptr, table, lock_type, mdl_type, table_options, diff --git a/sql/table.cc b/sql/table.cc index 1906acd14e2..373c70c5983 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -5865,6 +5865,7 @@ TABLE_LIST::TABLE_LIST(THD *thd, List *index_hints_ptr, LEX_STRING *option_ptr) { + reset(); db= db_str; is_fqtn= fqtn; alias= alias_str;