]> granicus.if.org Git - php/commitdiff
Fixed bug #40121 (PDO_DBLIB driver wont free statements).
authorIlia Alshanetsky <iliaa@php.net>
Sun, 14 Jan 2007 16:57:50 +0000 (16:57 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 14 Jan 2007 16:57:50 +0000 (16:57 +0000)
NEWS
ext/pdo_dblib/dblib_stmt.c

diff --git a/NEWS b/NEWS
index 827fc2683dcd68a6b52cd188aa395ad0413f147f..c3de7d11b0e281213a6f88ae1ed3f36daa078ecf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ PHP                                                                        NEWS
 - Added CURLOPT_TCP_NODELAY constant to Curl extension. (Sara)
 - Improved proc_open(). Now on Windows it can run external commands not through
   CMD.EXE. (Dmitry)
+- Fixed bug #40121 (PDO_DBLIB driver wont free statements). (Ilia)
 - Fixed bug #40098 (php_fopen_primary_script() not thread safe). (Ilia)
 - Fixed bug #40091 (spl_autoload_register with 2 instances of the same
   class). (Ilia)
index 4f985e91d1f43ca4f76f92699c03299f80668bd5..3be4876a3cfbc732fa66188a169bcccc1b522d04 100644 (file)
@@ -250,6 +250,17 @@ static int pdo_dblib_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
        return 1;
 }
 
+static int dblib_mysql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+{
+       pdo_dblib_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+
+       if (S->rows) {
+               free_rows(S TSRMLS_CC);
+               S->rows = NULL;
+       }
+
+       return 1;
+}
 
 struct pdo_stmt_methods dblib_stmt_methods = {
        pdo_dblib_stmt_dtor,
@@ -261,5 +272,7 @@ struct pdo_stmt_methods dblib_stmt_methods = {
        NULL, /* set attr */
        NULL, /* get attr */
        NULL, /* meta */
+       NULL, /* nextrow */
+       dblib_mysql_stmt_cursor_closer
 };