summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2011-08-24 10:15:47 +0000
committerXinchen Hui <laruence@php.net>2011-08-24 10:15:47 +0000
commitd7e0ccbc5a3b8ad67e49d4183d27a311ca2a9537 (patch)
tree71e76ac8898d3ef957802197ddf5112b16591c3d
parent562d5ec4a2c822f9e1123d5e2523b8ff2e7c5c5e (diff)
downloadphp-git-d7e0ccbc5a3b8ad67e49d4183d27a311ca2a9537.tar.gz
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
-rw-r--r--ext/mysql/tests/bug55473.phpt7
-rwxr-xr-xext/mysql/tests/mysql_pconn_kill.phpt2
-rw-r--r--ext/mysqlnd/mysqlnd_charset.c4
3 files changed, 9 insertions, 4 deletions
diff --git a/ext/mysql/tests/bug55473.phpt b/ext/mysql/tests/bug55473.phpt
index d492e68349..3a145fd780 100644
--- a/ext/mysql/tests/bug55473.phpt
+++ b/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! \ No newline at end of file
+done!
diff --git a/ext/mysql/tests/mysql_pconn_kill.phpt b/ext/mysql/tests/mysql_pconn_kill.phpt
index 8543e39d6c..efef421604 100755
--- a/ext/mysql/tests/mysql_pconn_kill.phpt
+++ b/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);
diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c
index 6792229d10..a87b2a1f4f 100644
--- a/ext/mysqlnd/mysqlnd_charset.c
+++ b/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 */
}