Commit 8746b6a1 authored by unknown's avatar unknown

More small WL#1622 fixes: Allocate name of Prepared Statement on PS's mem_root.


sql/sql_prepare.cc:
  Allocate name of Prepared Statement on PS's mem_root.
parent 47322bf9
......@@ -1463,8 +1463,8 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
if (name)
{
stmt->name.length= name->length;
if (!(stmt->name.str= my_memdup((byte*)name->str, name->length,
MYF(MY_WME))))
if (!(stmt->name.str= memdup_root(&stmt->mem_root, (byte*)name->str,
name->length)))
{
delete stmt;
send_error(thd, ER_OUT_OF_RESOURCES);
......@@ -1874,8 +1874,6 @@ Prepared_statement::Prepared_statement(THD *thd_arg)
Prepared_statement::~Prepared_statement()
{
free_items(free_list);
if (name.str)
my_free(name.str, MYF(0));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment