summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2012-08-09 15:34:52 +0400
committerSergey Glukhov <sergey.glukhov@oracle.com>2012-08-09 15:34:52 +0400
commitaf3fdefca52ace7f94c0b7217dbb4ea678829a3b (patch)
tree45667344474d3cdd896bdb5596f052371ec18359 /sql/item_subselect.cc
parent7e7ba738a2297e112f3cc21c05d3befa1769539b (diff)
downloadmariadb-git-af3fdefca52ace7f94c0b7217dbb4ea678829a3b.tar.gz
Bug #14409015 MEMORY LEAK WHEN REFERENCING OUTER FIELD IN HAVING
When resolving outer fields, Item_field::fix_outer_fields() creates new Item_refs for each execution of a prepared statement, so these must be allocated in the runtime memroot. The memroot switching before resolving JOIN::having causes these to be allocated in the statement root, leaking memory for each PS execution.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 46d49797b9c..2c91d0573c1 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1135,7 +1135,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
}
else
{
- Item *item= (Item*) select_lex->item_list.head();
+ Item *item= (Item*) select_lex->item_list.head()->real_item();
if (select_lex->table_list.elements)
{