summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-02-12 03:10:26 +0200
committerbell@sanja.is.com.ua <>2004-02-12 03:10:26 +0200
commit272bd74abb41e0e0bf16be2ae74f44d4df839d06 (patch)
treeec08c4d5b30f56815e8bfdacd0319bbcbd9f1abb /sql/sql_lex.cc
parent2fa0c78ec4fd2b64cbbfe072d425287e501c3784 (diff)
downloadmariadb-git-272bd74abb41e0e0bf16be2ae74f44d4df839d06.tar.gz
memory leacks in PS with subqueries fixed (adddition to fix of BUG#2462)
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index f08cf5cf967..4bc04ddf9ac 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1496,11 +1496,17 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
{
if (ref_pointer_array)
return 0;
+
+ /*
+ We have to create array in prepared statement memory if it is
+ prepared statement
+ */
+ Statement *stmt= thd->current_statement ? thd->current_statement : thd;
return (ref_pointer_array=
- (Item **)thd->alloc(sizeof(Item*) *
- (item_list.elements +
- select_n_having_items +
- order_group_num)* 5)) == 0;
+ (Item **)stmt->alloc(sizeof(Item*) *
+ (item_list.elements +
+ select_n_having_items +
+ order_group_num)* 5)) == 0;
}