php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52958
Patch 52958-PHP-5.4-20120623.patch revision 2012-06-23 09:26 UTC by hswong3i at gmail dot com
Patch 52958-fix-pdo-oci-cleanups.patch revision 2010-10-06 19:34 UTC by kontakt at beberlei dot de
revision 2010-10-06 19:22 UTC by kontakt at beberlei dot de

Patch 52958-PHP-5.4-20120623.patch for PDO related Bug #52958

Patch version 2012-06-23 09:26 UTC

Return to Bug #52958 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: hswong3i@gmail.com

From 86a102878e6dec750414df517911cde801fa24c6 Mon Sep 17 00:00:00 2001
From: Wong Hoi Sing Edison <hswong3i@gmail.com>
Date: Sat, 23 Jun 2012 16:51:36 +0800
Subject: [PATCH 1/2] Bug #52958 Segfault in PDO_OCI on cleanup after running
 a long testsuite.

---
 ext/pdo_oci/oci_driver.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index cb920ab..3e2040e 100755
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -227,8 +227,10 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
 		H->server = NULL;
 	}
 
-	OCIHandleFree(H->err, OCI_HTYPE_ERROR);
-	H->err = NULL;
+	if (H->err) {
+		OCIHandleFree(H->err, OCI_HTYPE_ERROR);
+		H->err = NULL;
+	}
 
 	if (H->charset && H->env) {
 		OCIHandleFree(H->env, OCI_HTYPE_ENV);
-- 
1.7.9.5


From d4c5648da21602253e66b96eadcadd31c81e62a6 Mon Sep 17 00:00:00 2001
From: Wong Hoi Sing Edison <hswong3i@gmail.com>
Date: Sat, 23 Jun 2012 17:16:31 +0800
Subject: [PATCH 2/2] Bug #52958 Segfault in PDO_OCI on cleanup after running
 a long testsuite (Part 2).

---
 ext/pdo_oci/oci_driver.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index 3e2040e..e43eeb4 100755
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -201,7 +201,7 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
 
 	if (H->svc) {
 		/* rollback any outstanding work */
-		OCITransRollback(H->svc, H->err, 0);
+		OCISessionEnd(H->svc, H->err, H->session, 0);
 	}
 
 	if (H->session) {
@@ -209,11 +209,6 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
 		H->session = NULL;
 	}
 
-	if (H->svc) {
-		OCIHandleFree(H->svc, OCI_HTYPE_SVCCTX);
-		H->svc = NULL;
-	}
-
 	if (H->server && H->attached) {
 		H->last_err = OCIServerDetach(H->server, H->err, OCI_DEFAULT);
 		if (H->last_err) {
@@ -222,6 +217,11 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
 		H->attached = 0;
 	}
 
+	if (H->svc) {
+		OCIHandleFree(H->svc, OCI_HTYPE_SVCCTX);
+		H->svc = NULL;
+	}
+
 	if (H->server) {
 		OCIHandleFree(H->server, OCI_HTYPE_SERVER);
 		H->server = NULL;
-- 
1.7.9.5

 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 13:02:46 2014 UTC