Author: uwendel
Date: 2007-08-10 12:17:26 +0200 (Fri, 10 Aug 2007)
New Revision: 872
Added:
trunk/tests/ext/mysqli/mysqli_pconn_kill.phpt
Log:
Playing a bit more with persistent connections. A mysqlnd
user has issues with them.
Added: trunk/tests/ext/mysqli/mysqli_pconn_kill.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_pconn_kill.phpt 2007-08-09 15:03:33 UTC (rev 871)
+++ trunk/tests/ext/mysqli/mysqli_pconn_kill.phpt 2007-08-10 10:17:26 UTC (rev 872)
@@ -0,0 +1,43 @@
+--TEST--
+Forking a child and using the same connection.
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--INI--
+mysqli.allow_persistent=1
+mysqli.max_persistent=1
+--FILE--
+<?php
+ require_once("connect.inc");
+ require_once("table.inc");
+
+ $host = 'p:' . $host;
+ if (!$plink = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
+ printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***,
dbname=%s, port=%s, socket=%s\n",
+ $host, $user, $db, $port, $socket);
+
+ // Kill the persistent connection - don't use mysqli_kill, mysqlnd will catch that...
+ $pthread_id = mysqli_thread_id($plink);
+ if (!mysqli_query($link, sprintf('KILL %d', $pthread_id)))
+ printf("[002] Cannot kill persistent connection, [%d] %s\n", mysqli_errno($link),
mysqli_error($link));
+
+ if ($res = @mysql_query($plink, 'SELECT id FROM test ORDER BY id LIMIT 1'))
+ printf("[003] Persistent connection can still execute queries.");
+ var_dump(mysqli_errno($plink));
+ var_dump(mysqli_error($plink));
+ var_dump(@mysqli_ping($plink));
+ print "done!";
+?>
+--EXPECTF--
+int(0)
+string(0) ""
+bool(false)
+done!
+--UEXPECTF--
+int(0)
+unicode(0) ""
+bool(false)
+done!
\ No newline at end of file
Property changes on: trunk/tests/ext/mysqli/mysqli_pconn_kill.phpt
___________________________________________________________________
Name: svn:executable
+ *
| Thread |
|---|
| • PHP mysqlnd svn commit: r872 - trunk/tests/ext/mysqli | uwendel | 10 Aug |