Description:
static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
bool create_if_not_exists)
{
user_var_entry *entry;
user_var_entry is a class with a constructor. get_variable uses my_malloc to allocate it, preventing the constructor from being called. Fortunately, the constructor is empty. If nothing else, add a comment to the constructor indicating that this is done.
---
From get_variable()
...
if (!(entry = (user_var_entry*) hash_search(hash, (byte*) name.str,
name.length)) &&
create_if_not_exists)
{
uint size=ALIGN_SIZE(sizeof(user_var_entry))+name.length+1+extra_size;
if (!hash_inited(hash))
return 0;
if (!(entry = (user_var_entry*) my_malloc(size,MYF(MY_WME))))
return 0;
entry->name.str=(char*) entry+ ALIGN_SIZE(sizeof(user_var_entry))+
extra_size;
entry->name.length=name.length;
entry->value=0;
entry->length=0;
entry->update_query_id=0;
entry->collation.set(NULL, DERIVATION_IMPLICIT);
entry->unsigned_flag= 0;
entry->may_be_set= 0;
/*
How to repeat:
NA
Description: static user_var_entry *get_variable(HASH *hash, LEX_STRING &name, bool create_if_not_exists) { user_var_entry *entry; user_var_entry is a class with a constructor. get_variable uses my_malloc to allocate it, preventing the constructor from being called. Fortunately, the constructor is empty. If nothing else, add a comment to the constructor indicating that this is done. --- From get_variable() ... if (!(entry = (user_var_entry*) hash_search(hash, (byte*) name.str, name.length)) && create_if_not_exists) { uint size=ALIGN_SIZE(sizeof(user_var_entry))+name.length+1+extra_size; if (!hash_inited(hash)) return 0; if (!(entry = (user_var_entry*) my_malloc(size,MYF(MY_WME)))) return 0; entry->name.str=(char*) entry+ ALIGN_SIZE(sizeof(user_var_entry))+ extra_size; entry->name.length=name.length; entry->value=0; entry->length=0; entry->update_query_id=0; entry->collation.set(NULL, DERIVATION_IMPLICIT); entry->unsigned_flag= 0; entry->may_be_set= 0; /* How to repeat: NA