php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #53567
Patch pdo-persistence-fix revision 2010-12-17 21:08 UTC by algernon at balabit dot hu

Patch pdo-persistence-fix for PDO PgSQL Bug #53567

Patch version 2010-12-17 21:08 UTC

Return to Bug #53567 | Download this patch
Patch Revisions:

Developer: algernon@balabit.hu

Fix PDO's persistance handling.

After retrieving a DBH object from the persistent storage, make sure
that the stored query statement (and the associated zval) are cleared.
Index: php5/ext/pdo/pdo_dbh.c
===================================================================
--- php5.orig/ext/pdo/pdo_dbh.c	2010-12-17 09:30:17.840555266 +0100
+++ php5/ext/pdo/pdo_dbh.c	2010-12-17 09:31:07.560591259 +0100
@@ -308,6 +308,8 @@
 						pdbh = NULL;
 					}
 				}
+				pdbh->query_stmt = NULL;
+				memset (&pdbh->query_stmt_zval, 0, sizeof (pdbh->query_stmt_zval));
 			}
 
 			if (pdbh) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 11:01:31 2024 UTC