From: Xinchen Hui Date: Wed, 24 Aug 2011 08:00:23 +0000 (+0000) Subject: Apply r315270 to 5.3 X-Git-Tag: php-5.3.9RC1~341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=344136e8e9d2b3fea54ad7450723c524fe88ef19;p=php Apply r315270 to 5.3 Fixed test script failed when host mysql doesn't listen on 3306 Fxied test script failed due to mysql_pconnect trigger a warning --- diff --git a/ext/mysql/tests/bug55473.phpt b/ext/mysql/tests/bug55473.phpt index d492e68349..6fafc4cd21 100644 --- a/ext/mysql/tests/bug55473.phpt +++ b/ext/mysql/tests/bug55473.phpt @@ -15,6 +15,11 @@ mysql.allow_persistent=1 packet_no = net->compressed_envelope_packet_no = 0; + if (net->stream) { + /* close before opening a new one */ + DBG_INF_FMT("Freeing stream. abstract=%p", net->stream->abstract); + if (net->persistent) { + php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR); + } else { + php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE); + } + net->stream = NULL; + } + if (net->options.timeout_connect) { tv.tv_sec = net->options.timeout_connect; tv.tv_usec = 0;