List:Commits« Previous MessageNext Message »
From:uwendel Date:March 16 2007 10:54am
Subject:PHP mysqlnd svn commit: r173 - trunk/ext/mysqli/tests
View as plain text  
Author: uwendel
Date: 2007-03-16 11:54:26 +0100 (Fri, 16 Mar 2007)
New Revision: 173

Modified:
   trunk/ext/mysqli/tests/mysqli_kill.phpt
Log:
MySQLnd should have a better thread id in the error message (currently: overflow).
libmysql does not like the sequence, that's why the report test fails for PHP6/libmysql 
(bug #25371?).


Modified: trunk/ext/mysqli/tests/mysqli_kill.phpt
===================================================================
--- trunk/ext/mysqli/tests/mysqli_kill.phpt	2007-03-16 10:46:09 UTC (rev 172)
+++ trunk/ext/mysqli/tests/mysqli_kill.phpt	2007-03-16 10:54:26 UTC (rev 173)
@@ -38,7 +38,29 @@
     var_dump($res);
     var_dump($link);    
         
-    mysqli_close($link);    
+    mysqli_close($link);
+    
+    if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
+        printf("[008] Cannot connect, [%d] %s\n", mysqli_connect_errno(),
mysqli_connect_error());
+        
+    mysqli_kill($link, -1);
+    if ((!$res = mysqli_query($link, "SELECT id FROM test LIMIT 1")) ||     
+        (!$tmp = mysqli_fetch_assoc($res))) {
+        printf("[009] Connection should not be gone, [%d] %s\n", mysqli_errno($link),
mysqli_error($link));        
+    }
+    var_dump($tmp);
+    mysqli_free_result($res);
+    mysqli_close($link);
+    
+    if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
+        printf("[010] Cannot connect, [%d] %s\n", mysqli_connect_errno(),
mysqli_connect_error());
+    
+    mysqli_change_user($link, "This might work if you accept anonymous users in your
setup", "password", $db);      mysqli_kill($link, -1);
+    // And a flaw in mysqlnd
+    if (!stristr($tmp = mysqli_error($link), "-1"))
+        printf("[011] Expecting to see the thread id -1 in the error message, got
'%s'\n", $tmp);
+    mysqli_close($link);
+    
     print "done!";
 ?>
 --EXPECTF--
@@ -46,4 +68,8 @@
 bool(false)
 object(mysqli)#%d (0) {
 }
+array(1) {
+  ["id"]=>
+  string(1) "1"
+}
 done!
\ No newline at end of file

Thread
PHP mysqlnd svn commit: r173 - trunk/ext/mysqli/testsuwendel16 Mar