From 32a41e5a25b9683ef79f5787d211c96561637e77 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Fri, 6 May 2011 17:39:20 +0400 Subject: Patch for Bug#12374486 - SEVERE MEMORY LEAK IN PREPARED STATEMENTS THAT CALL STORED PROCEDURES. The bug was introduced by WL#4435. The problem was that if a stored procedure generated a few result sets with different set of columns, a new memory would be allocated after every EXECUTE for every result set. The fix is to introduce a new memory root in scope of MYSQL_STMT, and to store result-set metadata in that memory root. --- include/mysql.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/mysql.h') diff --git a/include/mysql.h b/include/mysql.h index d3b24f0198a..1966caefdc1 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -573,6 +573,8 @@ typedef struct st_mysql_bind } MYSQL_BIND; +struct st_mysql_stmt_extension; + /* statement handler */ typedef struct st_mysql_stmt { @@ -618,7 +620,7 @@ typedef struct st_mysql_stmt metadata fields when doing mysql_stmt_store_result. */ my_bool update_max_length; - void *extension; + struct st_mysql_stmt_extension *extension; } MYSQL_STMT; enum enum_stmt_attr_type -- cgit v1.2.1