summaryrefslogtreecommitdiff
path: root/ext/mysql/tests
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2011-08-24 08:00:23 +0000
committerXinchen Hui <laruence@php.net>2011-08-24 08:00:23 +0000
commit344136e8e9d2b3fea54ad7450723c524fe88ef19 (patch)
tree26a955f44fa5600eb02246985e40e11bd22a433e /ext/mysql/tests
parent04b5bb7d3c5940cd665682c2e6f28b9c7f1044f0 (diff)
downloadphp-git-344136e8e9d2b3fea54ad7450723c524fe88ef19.tar.gz
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
Diffstat (limited to 'ext/mysql/tests')
-rw-r--r--ext/mysql/tests/bug55473.phpt7
-rwxr-xr-xext/mysql/tests/mysql_pconn_kill.phpt4
2 files changed, 9 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
<?php
include "connect.inc";
+ if ($socket)
+ $host = sprintf("%s:%s", $host, $socket);
+ else if ($port)
+ $host = sprintf("%s:%s", $host, $port);
+
$tmp = NULL;
$link = NULL;
@@ -68,4 +73,4 @@ OK
Warning: mysql_ping(): MySQL server has gone away in %s on line %d
reconnect
OK
-done! \ No newline at end of file
+done!
diff --git a/ext/mysql/tests/mysql_pconn_kill.phpt b/ext/mysql/tests/mysql_pconn_kill.phpt
index 8543e39d6c..20dfbe9a15 100755
--- a/ext/mysql/tests/mysql_pconn_kill.phpt
+++ b/ext/mysql/tests/mysql_pconn_kill.phpt
@@ -64,7 +64,9 @@ mysql.max_persistent=2
mysql_close($plink);
- if (!($plink = mysql_pconnect($myhost, $user, $passwd)))
+ /* mysql_pconnect cound generate a warning when linked against mysqlnd
+ PHP Warning: mysql_pconnect(): MySQL server has gone away */
+ if (!($plink = @mysql_pconnect($myhost, $user, $passwd)))
printf("[009] Cannot create new persistent connection, [%d] %s\n", mysql_errno(), mysql_error());
mysql_select_db($db, $plink);