List:Commits« Previous MessageNext Message »
From:uwendel Date:September 14 2007 3:56pm
Subject:PHP mysqlnd svn commit: r1045 - trunk/tests/ext/mysqli
View as plain text  
Author: uwendel
Date: 2007-09-14 15:56:51 +0200 (Fri, 14 Sep 2007)
New Revision: 1045

Modified:
   trunk/tests/ext/mysqli/mysqli_real_connect.phpt
Log:
As requested by Andrey, starting to test pconnect with real_connect.


Modified: trunk/tests/ext/mysqli/mysqli_real_connect.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_real_connect.phpt	2007-09-14 13:03:54 UTC (rev 1044)
+++ trunk/tests/ext/mysqli/mysqli_real_connect.phpt	2007-09-14 13:56:51 UTC (rev 1045)
@@ -102,9 +102,15 @@
 	if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, 65536))
 		printf("[016] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
 
-	if (mysqli_query($link, "SELECT 1 AS a; SELECT 2 AS b"))
+	if ($res = mysqli_query($link, "SELECT 1 AS a; SELECT 2 AS b")) {
 		printf("[017] Should have failed. CLIENT_MULTI_STATEMENT should have been
disabled.\n");
+		var_dump($res->num_rows);
+		mysqli_next_result($link);
+		$res = mysqli_store_result($link);
+		var_dump($res->num_rows);
+	}
 
+
 	mysqli_close($link);
 	if (!$link = mysqli_init())
 		printf("[018] mysqli_init() failed\n");
@@ -131,8 +137,34 @@
 
 	mysqli_close($link);
 
+	if ($IS_MYSQLND) {
+		ini_set('mysqli.default_host', 'p:' . $host);
+		$link = mysqli_init();
+		if (!@mysqli_real_connect($link)) {
+			printf("[022] Usage of mysqli.default_host=p:%s (persistent) failed\n", $host) ;
+		} else {
+			if (!$res = mysqli_query($link, "SELECT 'mysqli.default_host (persistent)' AS
'testing'"))
+				printf("[023] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+			$tmp = mysqli_fetch_assoc($res);
+			if ($tmp['testing'] !== 'mysqli.default_host (persistent)') {
+				printf("[024] Result looks strange - check manually, [%d] %s\n",
+					mysqli_errno($link), mysqli_error($link));
+				var_dump($tmp);
+			}
+			mysqli_free_result($res);
+			mysqli_close($link);
+		}
+
+		ini_set('mysqli.default_host', 'p:');
+		$link = mysqli_init();
+		if (@mysqli_real_sconnect($link)) {
+			printf("[025] Usage of mysqli.default_host=p: did not fail\n") ;
+			mysqli_close($link);
+		}
+	}
+
 	if (NULL !== ($tmp = mysqli_real_connect($link, $host, $user, $passwd, $db, $port,
$socket)))
-		printf("[022] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+		printf("[026] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
 
 	print "done!";
 ?>

Thread
PHP mysqlnd svn commit: r1045 - trunk/tests/ext/mysqliuwendel14 Sep