php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #55473
Patch Bug55473.diff revision 2011-08-22 08:33 UTC by laruence@php.net

Patch Bug55473.diff for MySQL related Bug #55473

Patch version 2011-08-22 08:33 UTC

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

Developer: laruence@php.net

Index: trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- trunk/ext/mysqlnd/mysqlnd.c	(revision 315268)
+++ trunk/ext/mysqlnd/mysqlnd.c	(working copy)
@@ -987,6 +987,14 @@
 			/* OOM */
 			DBG_RETURN(NULL);
 		}
+	} else if (conn->net && conn->net->stream) {
+		/* see bug #55473 */
+		if (conn->persistent) {
+			php_stream_free(conn->net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
+		} else {
+			php_stream_free(conn->net->stream, PHP_STREAM_FREE_CLOSE);
+		}
+		conn->net->stream = NULL;
 	}
 
 	ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);
Index: branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===================================================================
--- branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	(revision 315268)
+++ branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	(working copy)
@@ -867,6 +867,14 @@
 			/* OOM */
 			DBG_RETURN(NULL);
 		}
+	} else if (conn->net && conn->net->stream) {
+		/* see bug #55473 */
+		if (conn->persistent) {
+			php_stream_free(conn->net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
+		} else {
+			php_stream_free(conn->net->stream, PHP_STREAM_FREE_CLOSE);
+		}
+		conn->net->stream = NULL;
 	}
 
 	ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);
Index: branches/PHP_5_4/ext/mysqlnd/mysqlnd.c
===================================================================
--- branches/PHP_5_4/ext/mysqlnd/mysqlnd.c	(revision 315268)
+++ branches/PHP_5_4/ext/mysqlnd/mysqlnd.c	(working copy)
@@ -987,6 +987,14 @@
 			/* OOM */
 			DBG_RETURN(NULL);
 		}
+	} else if (conn->net && conn->net->stream) {
+		/* see bug #55473 */
+		if (conn->persistent) {
+			php_stream_free(conn->net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
+		} else {
+			php_stream_free(conn->net->stream, PHP_STREAM_FREE_CLOSE);
+		}
+		conn->net->stream = NULL;
 	}
 
 	ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC