mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix mysql tests with non-standard server port
Closes GH-9744
This commit is contained in:
parent
af6b413691
commit
0ab51a9561
2 changed files with 4 additions and 4 deletions
|
@ -11,14 +11,14 @@ require_once('skipifconnectfailure.inc');
|
||||||
require_once("connect.inc");
|
require_once("connect.inc");
|
||||||
|
|
||||||
/* Initial persistent connection */
|
/* Initial persistent connection */
|
||||||
$mysql_1 = new mysqli('p:'.$host, $user, $passwd, $db);
|
$mysql_1 = new mysqli('p:'.$host, $user, $passwd, $db, $port);
|
||||||
$result = $mysql_1->query("SHOW STATUS LIKE 'Connections'");
|
$result = $mysql_1->query("SHOW STATUS LIKE 'Connections'");
|
||||||
$c1 = $result->fetch_row();
|
$c1 = $result->fetch_row();
|
||||||
$result->free();
|
$result->free();
|
||||||
$mysql_1->close();
|
$mysql_1->close();
|
||||||
|
|
||||||
/* Failed connection to invalid host */
|
/* Failed connection to invalid host */
|
||||||
$mysql_2 = @new mysqli(' !!! invalid !!! ', $user, $passwd, $db);
|
$mysql_2 = @new mysqli(' !!! invalid !!! ', $user, $passwd, $db, $port);
|
||||||
try {
|
try {
|
||||||
$mysql_2->close();
|
$mysql_2->close();
|
||||||
} catch (Error $exception) {
|
} catch (Error $exception) {
|
||||||
|
@ -26,7 +26,7 @@ require_once('skipifconnectfailure.inc');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Re-use persistent connection */
|
/* Re-use persistent connection */
|
||||||
$mysql_3 = new mysqli('p:'.$host, $user, $passwd, $db);
|
$mysql_3 = new mysqli('p:'.$host, $user, $passwd, $db, $port);
|
||||||
$error = mysqli_connect_errno();
|
$error = mysqli_connect_errno();
|
||||||
$result = $mysql_3->query("SHOW STATUS LIKE 'Connections'");
|
$result = $mysql_3->query("SHOW STATUS LIKE 'Connections'");
|
||||||
$c3 = $result->fetch_row();
|
$c3 = $result->fetch_row();
|
||||||
|
|
|
@ -14,7 +14,7 @@ class cc{
|
||||||
function __construct($c=null){
|
function __construct($c=null){
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$i=mysqli_connect('p:'.$host, $user, $passwd, $db);
|
$i=mysqli_connect('p:'.$host, $user, $passwd, $db, $port);
|
||||||
$res=mysqli_query($i, "SHOW STATUS LIKE 'Connections'");
|
$res=mysqli_query($i, "SHOW STATUS LIKE 'Connections'");
|
||||||
$t=array(new stdClass);
|
$t=array(new stdClass);
|
||||||
while($db= mysqli_fetch_object($res,'cc',$t)){}
|
while($db= mysqli_fetch_object($res,'cc',$t)){}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue