From 9137acc7ecdf1542fe6fda5056a0273359682735 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 27 Feb 2014 08:45:16 +0100 Subject: Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed Each new mysqli_stmt now increase the refcount of the link object. So the link is really destroy after all statements. Only implemented with libmysqlclient, as mysqlnd already implement this internally. So, libmysqlclient and mysqlnd have the same behavior. --- ext/mysqli/php_mysqli_structs.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/mysqli/php_mysqli_structs.h') diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index d652592707..d2fb34b908 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -116,6 +116,10 @@ typedef struct { BIND_BUFFER param; BIND_BUFFER result; char *query; +#ifndef MYSQLI_USE_MYSQLND + /* used to manage refcount with libmysql (already implement in mysqlnd) */ + zend_object_handle link_handle; +#endif } MY_STMT; typedef struct { -- cgit v1.2.1