Commit 1eb58821 authored by sergefp@mysql.com's avatar sergefp@mysql.com

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

parent 9a4acccd
...@@ -1463,8 +1463,8 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, ...@@ -1463,8 +1463,8 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
if (name) if (name)
{ {
stmt->name.length= name->length; stmt->name.length= name->length;
if (!(stmt->name.str= my_memdup((byte*)name->str, name->length, if (!(stmt->name.str= memdup_root(&stmt->mem_root, (byte*)name->str,
MYF(MY_WME)))) name->length)))
{ {
delete stmt; delete stmt;
send_error(thd, ER_OUT_OF_RESOURCES); send_error(thd, ER_OUT_OF_RESOURCES);
...@@ -1874,8 +1874,6 @@ Prepared_statement::Prepared_statement(THD *thd_arg) ...@@ -1874,8 +1874,6 @@ Prepared_statement::Prepared_statement(THD *thd_arg)
Prepared_statement::~Prepared_statement() Prepared_statement::~Prepared_statement()
{ {
free_items(free_list); 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