From 344136e8e9d2b3fea54ad7450723c524fe88ef19 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Wed, 24 Aug 2011 08:00:23 +0000 Subject: [PATCH] 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 --- ext/mysql/tests/bug55473.phpt | 7 ++++++- ext/mysql/tests/mysql_pconn_kill.phpt | 4 +++- ext/mysqlnd/mysqlnd_net.c | 11 +++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) 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; -- 2.50.1