summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests/bug51605.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/tests/bug51605.phpt')
-rw-r--r--ext/mysqli/tests/bug51605.phpt44
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/mysqli/tests/bug51605.phpt b/ext/mysqli/tests/bug51605.phpt
new file mode 100644
index 0000000..02328a5
--- /dev/null
+++ b/ext/mysqli/tests/bug51605.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #51605 Mysqli - zombie links
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--INI--
+mysqli.max_links = 1
+mysqli.allow_persistent = Off
+mysqli.max_persistent = 0
+mysqli.reconnect = Off
+--FILE--
+<?php
+ include ("connect.inc");
+
+ $link = mysqli_init();
+ if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
+ printf("[002] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+ }
+ mysqli_close($link);
+ echo "closed once\n";
+
+ $link = mysqli_init();
+ if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
+ printf("[002] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+ }
+ mysqli_close($link);
+ echo "closed twice\n";
+
+ $link = mysqli_init();
+ if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
+ printf("[003] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+ }
+ mysqli_close($link);
+ echo "closed for third time\n";
+
+ print "done!";
+?>
+--EXPECTF--
+closed once
+closed twice
+closed for third time
+done!