List:Commits« Previous MessageNext Message »
From:grichter Date:March 18 2007 9:49am
Subject:PHP mysqlnd svn commit: r189 - trunk/ext/mysqli/tests
View as plain text  
Author: grichter
Date: 2007-03-18 10:49:45 +0100 (Sun, 18 Mar 2007)
New Revision: 189

Added:
   trunk/ext/mysqli/tests/skipifnodefuser.inc
Modified:
   trunk/ext/mysqli/tests/connect.inc
   trunk/ext/mysqli/tests/mysqli_affected_rows.phpt
   trunk/ext/mysqli/tests/mysqli_affected_rows_oo.phpt
   trunk/ext/mysqli/tests/mysqli_connect_oo.phpt
   trunk/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt
Log:
added global variable IS_MYSQLND in connect.inc
fixed mysqli_affected_rows (different behaviour in libmysql and mysqlnd)
added includefile which checks if system supports getusername
fixed mysqli_connect_oo.phpt (is user is empty, process uid should be
used)


Modified: trunk/ext/mysqli/tests/connect.inc
===================================================================
--- trunk/ext/mysqli/tests/connect.inc	2007-03-18 09:12:58 UTC (rev 188)
+++ trunk/ext/mysqli/tests/connect.inc	2007-03-18 09:49:45 UTC (rev 189)
@@ -15,4 +15,6 @@
 	$db        = getenv("MYSQL_TEST_DB")       ? getenv("MYSQL_TEST_DB") : "phptest";
 	$engine    = getenv("MYSQL_TEST_ENGINE")   ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
 	$socket    = getenv("MYSQL_TEST_SOCKET")   ? getenv("MYSQL_TEST_SOCKET") : null;
-?>
\ No newline at end of file
+
+	$IS_MYSQLND = strpos(mysqli_get_client_info(), "mysqlnd");
+?>

Modified: trunk/ext/mysqli/tests/mysqli_affected_rows.phpt
===================================================================
--- trunk/ext/mysqli/tests/mysqli_affected_rows.phpt	2007-03-18 09:12:58 UTC (rev 188)
+++ trunk/ext/mysqli/tests/mysqli_affected_rows.phpt	2007-03-18 09:49:45 UTC (rev 189)
@@ -23,8 +23,9 @@
         printf("[004] Cannot connect to the server using host=%s, user=%s, passwd=***,
dbname=%s, port=%s, socket=%s\n",
             $host, $user, $db, $port, $socket);        
     
-    if (-1 !== ($tmp = mysqli_affected_rows($link))) 
-        printf("[005] Expecting int/1, got %s/%s. [%d] %s\n",
+	/* different behaviour in libmysql: skip if not using mysqlnd */
+    if ($IS_MYSQLND && (-1 !== ($tmp = mysqli_affected_rows($link)))) 
+        printf("[005] Expecting int/-1, got %s/%s. [%d] %s\n",
             gettype($tmp), $tmp, mysqli_errno($link), mysqli_error($link));
                 
     if (!mysqli_query($link, 'DROP TABLE IF EXISTS test'))

Modified: trunk/ext/mysqli/tests/mysqli_affected_rows_oo.phpt
===================================================================
--- trunk/ext/mysqli/tests/mysqli_affected_rows_oo.phpt	2007-03-18 09:12:58 UTC (rev 188)
+++ trunk/ext/mysqli/tests/mysqli_affected_rows_oo.phpt	2007-03-18 09:49:45 UTC (rev 189)
@@ -11,7 +11,9 @@
         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);        
     }
-    if (-1 !== ($tmp = $mysqli->affected_rows))
+	
+	/* different behaviour in libmysql: skip this */
+    if ($IS_MYSQLND && (-1 !== ($tmp = $mysqli->affected_rows)))
         printf("[002] Expecting int/-1, got %s/%s\n", gettype($tmp), $tmp);    
                 
     if (!$mysqli->query('DROP TABLE IF EXISTS test'))

Modified: trunk/ext/mysqli/tests/mysqli_connect_oo.phpt
===================================================================
--- trunk/ext/mysqli/tests/mysqli_connect_oo.phpt	2007-03-18 09:12:58 UTC (rev 188)
+++ trunk/ext/mysqli/tests/mysqli_connect_oo.phpt	2007-03-18 09:49:45 UTC (rev 189)
@@ -3,6 +3,7 @@
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 <?php require_once('skipifemb.inc'); ?>
+<?php require_once('skipifnodefuser.inc'); ?>
 --FILE--
 <?php
     include "connect.inc";
@@ -147,23 +148,23 @@
     print "done!";   
 ?>
 --EXPECTF--
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user ''@'%s' (using password: %s)
in %s on line %d
+Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s)
in %s on line %d
 
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user ''@'%s' (using password: %s)
in %s on line %d
+Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s)
in %s on line %d
 
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user ''@'%s' (using password: %s)
in %s on line %d
+Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s)
in %s on line %d
 
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user ''@'%s' (using password: %s)
in %s on line %d
+Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s)
in %s on line %d
 
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user ''@'%s' (using password: %s)
in %s on line %d
+Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s)
in %s on line %d
 
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user ''@'%s' (using password: %s)
in %s on line %d
+Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s)
in %s on line %d
 
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user ''@'%s' (using password: %s)
in %s on line %d
+Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s)
in %s on line %d
 
 Warning: mysqli::mysqli(): (%d/%d): Access denied for user 'rootunknown_real'@'%s' (using
password: %s) in %s on line %d
 
 Warning: mysqli::close(): Couldn't fetch mysqli in %s on line %d
 ... and now Exceptions
 Access denied for user '%s'@'%s' (using password: %s)
-done!
\ No newline at end of file
+done!

Modified: trunk/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt
===================================================================
--- trunk/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt	2007-03-18 09:12:58 UTC (rev
188)
+++ trunk/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt	2007-03-18 09:49:45 UTC (rev
189)
@@ -3,11 +3,12 @@
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 <?php require_once('skipifemb.inc'); ?>
+<?php require_once('skipifnodefuser.inc'); ?>
 --FILE--
 <?php
     include "connect.inc";
 
-    $myhost = '0.0.0.1';   
+    $myhost = 'invalidhost';   
     $link   = NULL;
     
     print "1) bail\n";               

Added: trunk/ext/mysqli/tests/skipifnodefuser.inc
===================================================================
--- trunk/ext/mysqli/tests/skipifnodefuser.inc	2007-03-18 09:12:58 UTC (rev 188)
+++ trunk/ext/mysqli/tests/skipifnodefuser.inc	2007-03-18 09:49:45 UTC (rev 189)
@@ -0,0 +1,5 @@
+<?php
+if (!get_current_user()){
+	die('get_current_user not supported');
+}
+?>

Thread
PHP mysqlnd svn commit: r189 - trunk/ext/mysqli/testsgrichter18 Mar