Commit 0d581562 authored by Aleksey Midenkov's avatar Aleksey Midenkov

Fix memory leak on Alter_drop allocation

Fixes 7f613ebd (MDEV-7284 INDEX: CREATE OR REPLACE).
parent 1657b7a5
...@@ -6719,7 +6719,7 @@ handle_if_exists_options(THD *thd, TABLE *table, Alter_info *alter_info, ...@@ -6719,7 +6719,7 @@ handle_if_exists_options(THD *thd, TABLE *table, Alter_info *alter_info,
DBUG_ASSERT(key->or_replace()); DBUG_ASSERT(key->or_replace());
Alter_drop::drop_type type= (key->type == Key::FOREIGN_KEY) ? Alter_drop::drop_type type= (key->type == Key::FOREIGN_KEY) ?
Alter_drop::FOREIGN_KEY : Alter_drop::KEY; Alter_drop::FOREIGN_KEY : Alter_drop::KEY;
Alter_drop *ad= new Alter_drop(type, key->name.str, FALSE); Alter_drop *ad= new (thd->mem_root) Alter_drop(type, key->name.str, FALSE);
if (ad != NULL) if (ad != NULL)
{ {
// Adding the index into the drop list for replacing // Adding the index into the drop list for replacing
......
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