laruence                                 Wed, 24 Aug 2011 10:15:47 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=315414

Log:
Eliminated compile warning "comparison is always false due to limited range of 
data type"
Fixed test failed due to mysql_pconnect throw warning
Fixed test failed when host mysql server doesn't listen on 3306

Changed paths:
    U   php/php-src/branches/PHP_5_4/ext/mysql/tests/bug55473.phpt
    U   php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_pconn_kill.phpt
    U   php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c
    U   php/php-src/trunk/ext/mysql/tests/bug55473.phpt
    U   php/php-src/trunk/ext/mysql/tests/mysql_pconn_kill.phpt
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c

Modified: php/php-src/branches/PHP_5_4/ext/mysql/tests/bug55473.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysql/tests/bug55473.phpt  2011-08-24 
10:05:10 UTC (rev 315413)
+++ php/php-src/branches/PHP_5_4/ext/mysql/tests/bug55473.phpt  2011-08-24 
10:15:47 UTC (rev 315414)
@@ -18,6 +18,11 @@
        $tmp    = NULL;
        $link   = NULL;

+       if ($socket)
+        $host = sprintf("%s:%s", $host, $socket);
+    else if ($port)
+        $host = sprintf("%s:%s", $host, $port);
+
        function connect($host, $user, $passwd) {
                $conn = mysql_pconnect($host, $user, $passwd);
                if (!$conn)
@@ -68,4 +73,4 @@
 Warning: mysql_ping(): MySQL server has gone away in %s on line %d
 reconnect
 OK
-done!
\ No newline at end of file
+done!

Modified: php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_pconn_kill.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_pconn_kill.phpt  
2011-08-24 10:05:10 UTC (rev 315413)
+++ php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_pconn_kill.phpt  
2011-08-24 10:15:47 UTC (rev 315414)
@@ -64,7 +64,7 @@

        mysql_close($plink);

-       if (!($plink = mysql_pconnect($myhost, $user, $passwd)))
+       if (!($plink = @mysql_pconnect($myhost, $user, $passwd)))
                printf("[009] Cannot create new persistent connection, [%d] 
%s\n", mysql_errno(), mysql_error());
        mysql_select_db($db, $plink);


Modified: php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c  2011-08-24 
10:05:10 UTC (rev 315413)
+++ php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c  2011-08-24 
10:15:47 UTC (rev 315414)
@@ -126,8 +126,8 @@
                if (!((start[1] ^ 0x80) < 0x40 &&
                        (start[2] ^ 0x80) < 0x40 &&
                        (start[3] ^ 0x80) < 0x40 &&
-                               (c >= 0xf1 || start[1] >= 0x90) &&
-                               (c <= 0xf3 || start[1] <= 0x8F)))
+                               (c >= 0xf1 || start[1] >= (char)0x90) &&
+                               (c <= 0xf3 || start[1] <= (char)0x8F)))
                {
                        return 0;       /* invalid utf8 character */
                }

Modified: php/php-src/trunk/ext/mysql/tests/bug55473.phpt
===================================================================
--- php/php-src/trunk/ext/mysql/tests/bug55473.phpt     2011-08-24 10:05:10 UTC 
(rev 315413)
+++ php/php-src/trunk/ext/mysql/tests/bug55473.phpt     2011-08-24 10:15:47 UTC 
(rev 315414)
@@ -18,6 +18,11 @@
        $tmp    = NULL;
        $link   = NULL;

+       if ($socket)
+        $host = sprintf("%s:%s", $host, $socket);
+    else if ($port)
+        $host = sprintf("%s:%s", $host, $port);
+
        function connect($host, $user, $passwd) {
                $conn = mysql_pconnect($host, $user, $passwd);
                if (!$conn)
@@ -68,4 +73,4 @@
 Warning: mysql_ping(): MySQL server has gone away in %s on line %d
 reconnect
 OK
-done!
\ No newline at end of file
+done!

Modified: php/php-src/trunk/ext/mysql/tests/mysql_pconn_kill.phpt
===================================================================
--- php/php-src/trunk/ext/mysql/tests/mysql_pconn_kill.phpt     2011-08-24 
10:05:10 UTC (rev 315413)
+++ php/php-src/trunk/ext/mysql/tests/mysql_pconn_kill.phpt     2011-08-24 
10:15:47 UTC (rev 315414)
@@ -64,7 +64,7 @@

        mysql_close($plink);

-       if (!($plink = mysql_pconnect($myhost, $user, $passwd)))
+       if (!($plink = @mysql_pconnect($myhost, $user, $passwd)))
                printf("[009] Cannot create new persistent connection, [%d] 
%s\n", mysql_errno(), mysql_error());
        mysql_select_db($db, $plink);


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c     2011-08-24 10:05:10 UTC 
(rev 315413)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c     2011-08-24 10:15:47 UTC 
(rev 315414)
@@ -126,8 +126,8 @@
                if (!((start[1] ^ 0x80) < 0x40 &&
                        (start[2] ^ 0x80) < 0x40 &&
                        (start[3] ^ 0x80) < 0x40 &&
-                               (c >= 0xf1 || start[1] >= 0x90) &&
-                               (c <= 0xf3 || start[1] <= 0x8F)))
+                               (c >= 0xf1 || start[1] >= (char)0x90) &&
+                               (c <= 0xf3 || start[1] <= (char)0x8F)))
                {
                        return 0;       /* invalid utf8 character */
                }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to