Browse Source

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
pull/7/head
Xinchen Hui 15 years ago
parent
commit
d7e0ccbc5a
  1. 7
      ext/mysql/tests/bug55473.phpt
  2. 2
      ext/mysql/tests/mysql_pconn_kill.phpt
  3. 4
      ext/mysqlnd/mysqlnd_charset.c

7
ext/mysql/tests/bug55473.phpt

@ -18,6 +18,11 @@ mysql.allow_persistent=1
$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 @@ OK
Warning: mysql_ping(): MySQL server has gone away in %s on line %d
reconnect
OK
done!
done!

2
ext/mysql/tests/mysql_pconn_kill.phpt

@ -64,7 +64,7 @@ mysql.max_persistent=2
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);

4
ext/mysqlnd/mysqlnd_charset.c

@ -126,8 +126,8 @@ static unsigned int check_mb_utf8_sequence(const char *start, const char *end)
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 */
}

Loading…
Cancel
Save