diff options
author | unknown <sanja@askmonty.org> | 2014-07-31 10:11:10 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2014-07-31 10:11:10 +0300 |
commit | a270e8abc4344654aaac1a6881cbb169165a3cf0 (patch) | |
tree | a6e95916d47fa9737e0d9ce31a874b91b9cfcef1 /sql/sql_derived.cc | |
parent | 53643152296f007eb698d44f067016889b4d8470 (diff) | |
download | mariadb-git-a270e8abc4344654aaac1a6881cbb169165a3cf0.tar.gz |
MDEV-6441: memory leak
mysql_derived_prepare() was executed on the statement memory.
Now it is executed on the runtime memory.
All bugs induced by this were fixed.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index be258c16356..004cccb41a9 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -614,6 +614,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) SELECT_LEX_UNIT *unit= derived->get_unit(); DBUG_ENTER("mysql_derived_prepare"); bool res= FALSE; + DBUG_PRINT("enter", ("unit 0x%lx", (ulong) unit)); // Skip already prepared views/DT if (!unit || unit->prepared || @@ -623,9 +624,6 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) thd->lex->sql_command == SQLCOM_DELETE_MULTI)))) DBUG_RETURN(FALSE); - Query_arena *arena, backup; - arena= thd->activate_stmt_arena_if_needed(&backup); - SELECT_LEX *first_select= unit->first_select(); /* prevent name resolving out of derived table */ @@ -743,8 +741,6 @@ exit: if (derived->outer_join) table->maybe_null= 1; } - if (arena) - thd->restore_active_arena(arena, &backup); DBUG_RETURN(res); } |