uw Wed Jul 1 12:52:59 2009 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/mysqli/tests mysqli_get_cache_stats_off.phpt
mysqli_get_connection_stats_off.phpt
Modified files:
/php-src/ext/mysqli/tests mysqli_get_cache_stats_free_buffered.phpt
mysqli_get_cache_stats.phpt
mysqli_get_client_stats_off.phpt
mysqli_get_client_stats_skipped.phpt
mysqli_get_connection_stats.phpt
Log:
MFH - Adding XFAIL for some tests which expect the zval cache of mysqlnd to
be on. It has been disabled for the PHP 5.3.0 release. Adding INI sections to
ensure that statistics are collected. Adding tests that check if statistics
collection can be disabled
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_cache_stats_free_buffered.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_get_cache_stats_free_buffered.phpt
diff -u
php-src/ext/mysqli/tests/mysqli_get_cache_stats_free_buffered.phpt:1.2.2.3
php-src/ext/mysqli/tests/mysqli_get_cache_stats_free_buffered.phpt:1.2.2.4
--- php-src/ext/mysqli/tests/mysqli_get_cache_stats_free_buffered.phpt:1.2.2.3
Thu May 28 14:33:42 2009
+++ php-src/ext/mysqli/tests/mysqli_get_cache_stats_free_buffered.phpt Wed Jul
1 12:52:58 2009
@@ -1,5 +1,10 @@
--TEST--
mysqli_get_cache_stats() - freeing for buffered result sets
+--XFAIL--
+zval caching has been temporarily disabled for the 5.3.0 release
+--INI--
+mysqlnd.collect_statistics="1"
+mysqlnd.collect_memory_statistics="1"
--SKIPIF--
<?PHP
require_once('skipif.inc');
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_cache_stats.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_get_cache_stats.phpt
diff -u php-src/ext/mysqli/tests/mysqli_get_cache_stats.phpt:1.2.2.3
php-src/ext/mysqli/tests/mysqli_get_cache_stats.phpt:1.2.2.4
--- php-src/ext/mysqli/tests/mysqli_get_cache_stats.phpt:1.2.2.3 Thu May
28 14:33:42 2009
+++ php-src/ext/mysqli/tests/mysqli_get_cache_stats.phpt Wed Jul 1
12:52:58 2009
@@ -1,5 +1,10 @@
--TEST--
mysqli_get_cache_stats()
+--XFAIL--
+zval caching has been temporarily disabled for the 5.3.0 release
+--INI--
+mysqlnd.collect_statistics="1"
+mysqlnd.collect_memory_statistics="1"
--SKIPIF--
<?PHP
require_once('skipif.inc');
@@ -22,9 +27,9 @@
var_dump($info);
- if ($info['size'] !== $info['free_items'])
+ if ($info["size"] !== $info['free_items'])
printf("[003] Unused cache should have size (%d) == free_items
(%d)\n",
- $info['size'], $info['free_items']);
+ $info["size"], $info['free_items']);
require_once('table.inc');
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_client_stats_off.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_get_client_stats_off.phpt
diff -u php-src/ext/mysqli/tests/mysqli_get_client_stats_off.phpt:1.1.2.1
php-src/ext/mysqli/tests/mysqli_get_client_stats_off.phpt:1.1.2.2
--- php-src/ext/mysqli/tests/mysqli_get_client_stats_off.phpt:1.1.2.1 Wed Oct
10 10:16:00 2007
+++ php-src/ext/mysqli/tests/mysqli_get_client_stats_off.phpt Wed Jul 1
12:52:58 2009
@@ -15,19 +15,25 @@
--FILE--
<?php
$before = mysqli_get_client_stats();
+ if (!is_array($before) || empty($before)) {
+ printf("[001] Expecting non-empty array, got %s.\n",
gettype($before));
+ var_dump($before);
+ }
+
// connect and table inc connect to mysql and create tables
require_once('connect.inc');
require_once('table.inc');
$after = mysqli_get_client_stats();
- if (!is_array($before) || empty($before)) {
- printf("[001] Expecting non-empty array, got %s.\n",
gettype($before));
+ if ($before !== $after) {
+ printf("[002] Statistics have changed\n");
var_dump($before);
+ var_dump($after);
}
foreach ($after as $k => $v)
if ($v != 0) {
- printf("[002] Field %s should not have any other value
but 0, got %s.\n",
+ printf("[003] Field %s should not have any other value
but 0, got %s.\n",
$k, $v);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt
diff -u php-src/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt:1.1.2.1
php-src/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt:1.1.2.2
--- php-src/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt:1.1.2.1
Wed Oct 10 10:16:00 2007
+++ php-src/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt Wed Jul
1 12:52:58 2009
@@ -1,5 +1,8 @@
--TEST--
mysqli_get_client_stats() - skipped rows
+--INI--
+mysqlnd.collect_statistics="1"
+mysqlnd.collect_memory_statistics="1"
--SKIPIF--
<?PHP
require_once('skipif.inc');
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_connection_stats.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_get_connection_stats.phpt
diff -u php-src/ext/mysqli/tests/mysqli_get_connection_stats.phpt:1.2.2.2
php-src/ext/mysqli/tests/mysqli_get_connection_stats.phpt:1.2.2.3
--- php-src/ext/mysqli/tests/mysqli_get_connection_stats.phpt:1.2.2.2 Wed Oct
10 10:16:00 2007
+++ php-src/ext/mysqli/tests/mysqli_get_connection_stats.phpt Wed Jul 1
12:52:58 2009
@@ -1,5 +1,8 @@
--TEST--
mysqli_get_connection_stats()
+--INI--
+mysqlnd.collect_statistics="1"
+mysqlnd.collect_memory_statistics="1"
--SKIPIF--
<?PHP
require_once('skipif.inc');
@@ -39,7 +42,7 @@
}
if ($info !== $info2) {
- printf("[005] The hashes should be identical\n");
+ printf("[005] The hashes should be identical except of the
memory related fields\n");
var_dump($info);
var_dump($info2);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_cache_stats_off.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_get_cache_stats_off.phpt
+++ php-src/ext/mysqli/tests/mysqli_get_cache_stats_off.phpt
--TEST--
mysqli_get_cache_stats() - disabled via php.ini
--INI--
mysqlnd.collect_statistics="0"
mysqlnd.collect_memory_statistics="0"
--SKIPIF--
<?PHP
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_get_cache_stats')) {
die("skip only available with mysqlnd");
}
?>
--FILE--
<?php
$before = mysqli_get_cache_stats();
if (!is_array($before) || empty($before)) {
printf("[001] Expecting non-empty array, got %s.\n",
gettype($before));
var_dump($before);
}
require_once('table.inc');
if (!$res = mysqli_query($link, "SELECT id, label FROM test")) {
printf("[002] [%d] %s\n", mysqli_errno($link),
mysqli_error($link));
}
while ($row = mysqli_fetch_assoc($res))
;
if (!$res = mysqli_query($link, "SELECT id, label FROM test")) {
printf("[003] [%d] %s\n", mysqli_errno($link),
mysqli_error($link));
}
while ($row = mysqli_fetch_assoc($res))
;
$after = mysqli_get_cache_stats();
if ($before !== $after) {
printf("[004] Statistics have changed\n");
var_dump($before);
var_dump($after);
}
$ignore = array("size" => true, "free_items" => true, "references" =>
true);
foreach ($after as $k => $v) {
if ($v != 0 && !isset($ignore[$k])) {
printf("[005] Field %s should not have any other value
but 0, got %s.\n",
$k, $v);
}
}
mysqli_close($link);
print "done!";
?>
--EXPECTF--
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt
+++ php-src/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt
--TEST--
mysqli_get_connection_stats() - disable via php.ini
--INI--
mysqlnd.collect_statistics="0"
mysqlnd.collect_memory_statistics="0"
--SKIPIF--
<?PHP
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_get_connection_stats')) {
die("skip only available with mysqlnd");
}
?>
--FILE--
<?php
// connect and table inc connect to mysql and create tables
require_once('connect.inc');
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port,
$socket)) {
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);
}
$before = mysqli_get_connection_stats($link);
if (!is_array($before) || empty($before)) {
printf("[002] Expecting non-empty array, got %s.\n",
gettype($before));
var_dump($before);
}
mysqli_close($link);
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port,
$socket)) {
printf("[003] Cannot connect to the server using host=%s,
user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
}
$after = mysqli_get_connection_stats($link);
if ($before !== $after) {
printf("[004] Statistics differ!");
var_dump($before);
var_dump($after);
}
foreach ($after as $k => $v)
if ($v != 0) {
printf("[004] Field %s should not have any other value
but 0, got %s.\n",
$k, $v);
}
mysqli_close($link);
print "done!";
?>
--EXPECTF--
done!
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php