From: Ulf Wendel Date: Tue, 20 Oct 2009 13:58:57 +0000 (+0000) Subject: Well, hacking around to cope with mysql version specific behaviour if using libmysql... X-Git-Tag: php-5.4.0alpha1~191^2~2483 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0aeb41c5d047c4d5fd6e183f91bfc3171efbdf67;p=php Well, hacking around to cope with mysql version specific behaviour if using libmysql... --- diff --git a/ext/mysqli/tests/071.phpt b/ext/mysqli/tests/071.phpt index 4788a60913..38bc46b84c 100644 --- a/ext/mysqli/tests/071.phpt +++ b/ext/mysqli/tests/071.phpt @@ -11,10 +11,28 @@ require_once('skipifconnectfailure.inc'); require_once("connect.inc"); $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket); + $version = $mysql->server_version; var_dump($mysql->ping()); - var_dump($mysql->kill($mysql->thread_id)); + $ret = $mysql->kill($mysql->thread_id); + if ($IS_MYSQLND) { + if ($ret !== true){ + printf("[001] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true)); + } + } else { + /* libmysql return value seems to depend on server version */ + if (($version >= 50123 || $version <= 40200) && $version != 50200) { + /* TODO: find exact version */ + if ($ret !== true){ + printf("[001] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version); + } + } else { + if ($ret !== false){ + printf("[001] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version); + } + } + } var_dump($mysql->ping()); @@ -24,7 +42,24 @@ require_once('skipifconnectfailure.inc'); var_dump(mysqli_ping($mysql)); - var_dump(mysqli_kill($mysql, mysqli_thread_id($mysql))); + $ret = $mysql->kill($mysql->thread_id); + if ($IS_MYSQLND) { + if ($ret !== true){ + printf("[002] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true)); + } + } else { + /* libmysql return value seems to depend on server version */ + if (($version >= 50123 || $version <= 40200) && $version != 50200) { + /* TODO: find exact version */ + if ($ret !== true){ + printf("[002] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version); + } + } else { + if ($ret !== false){ + printf("[002] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version); + } + } + } var_dump(mysqli_ping($mysql)); @@ -33,9 +68,7 @@ require_once('skipifconnectfailure.inc'); ?> --EXPECT-- bool(true) -bool(true) bool(false) bool(true) -bool(true) bool(false) done! \ No newline at end of file