andrey                                   Tue, 11 May 2010 15:49:03 +0000

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

Log:
Fix for mysqli_stmt_execute.phpt, should be ran only against
4.1+ servers. MySQL's SLEEP function is available since 5.0.12, thus
the tests that use this function should be ran only if the server
is at least 5.0.12.

Changed paths:
    U   
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt
    U   
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt
    U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_execute.phpt
    U   php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt
    U   php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt
    U   php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_execute.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt
===================================================================
--- 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt
 2010-05-11 15:27:03 UTC (rev 299250)
+++ 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt
 2010-05-11 15:49:03 UTC (rev 299251)
@@ -6,8 +6,16 @@
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');

-if (!stristr(mysqli_get_client_info(), 'mysqlnd'))
-        die("skip: test applies only to mysqlnd");
+if (!stristr(mysqli_get_client_info(), 'mysqlnd')) {
+       die("skip: test applies only to mysqlnd");
+}
+
+if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+       die(sprintf('skip Cannot connect to MySQL, [%d] %s.', 
mysqli_connect_errno(), mysqli_connect_error()));
+}
+if (mysqli_get_server_version($link) <= 50011) {
+       die(sprintf('skip Needs MySQL 5.0.12+, found version %d.', 
mysqli_get_server_version($link)));
+}
 ?>
 --INI--
 default_socket_timeout=1

Modified: 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt
===================================================================
--- 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt
 2010-05-11 15:27:03 UTC (rev 299250)
+++ 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt
 2010-05-11 15:49:03 UTC (rev 299251)
@@ -6,8 +6,16 @@
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');

-if (!stristr(mysqli_get_client_info(), 'mysqlnd'))
-        die("skip: test applies only to mysqlnd");
+if (!stristr(mysqli_get_client_info(), 'mysqlnd')) {
+       die("skip: test applies only to mysqlnd");
+}
+
+if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+       die(sprintf('skip Cannot connect to MySQL, [%d] %s.', 
mysqli_connect_errno(), mysqli_connect_error()));
+}
+if (mysqli_get_server_version($link) <= 50011) {
+       die(sprintf('skip Needs MySQL 5.0.12+, found version %d.', 
mysqli_get_server_version($link)));
+}
 ?>
 --INI--
 default_socket_timeout=10

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_execute.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_execute.phpt      
2010-05-11 15:27:03 UTC (rev 299250)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_stmt_execute.phpt      
2010-05-11 15:49:03 UTC (rev 299251)
@@ -5,6 +5,12 @@
 require_once('skipif.inc');
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');
+if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+       die(sprintf('skip Cannot connect to MySQL, [%d] %s.', 
mysqli_connect_errno(), mysqli_connect_error()));
+}
+if (mysqli_get_server_version($link) <= 40100) {
+       die(sprintf('skip Needs MySQL 4.1+, found version %d.', 
mysqli_get_server_version($link)));
+}
 ?>
 --FILE--
 <?php

Modified: 
php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt
===================================================================
--- php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt    
2010-05-11 15:27:03 UTC (rev 299250)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt    
2010-05-11 15:49:03 UTC (rev 299251)
@@ -6,8 +6,16 @@
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');

-if (!stristr(mysqli_get_client_info(), 'mysqlnd'))
-        die("skip: test applies only to mysqlnd");
+if (!stristr(mysqli_get_client_info(), 'mysqlnd')) {
+       die("skip: test applies only to mysqlnd");
+}
+
+if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+       die(sprintf('skip Cannot connect to MySQL, [%d] %s.', 
mysqli_connect_errno(), mysqli_connect_error()));
+}
+if (mysqli_get_server_version($link) <= 50011) {
+       die(sprintf('skip Needs MySQL 5.0.12+, found version %d.', 
mysqli_get_server_version($link)));
+}
 ?>
 --INI--
 default_socket_timeout=1

Modified: 
php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt
===================================================================
--- php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt    
2010-05-11 15:27:03 UTC (rev 299250)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt    
2010-05-11 15:49:03 UTC (rev 299251)
@@ -6,8 +6,16 @@
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');

-if (!stristr(mysqli_get_client_info(), 'mysqlnd'))
-        die("skip: test applies only to mysqlnd");
+if (!stristr(mysqli_get_client_info(), 'mysqlnd')) {
+       die("skip: test applies only to mysqlnd");
+}
+
+if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+       die(sprintf('skip Cannot connect to MySQL, [%d] %s.', 
mysqli_connect_errno(), mysqli_connect_error()));
+}
+if (mysqli_get_server_version($link) <= 50011) {
+       die(sprintf('skip Needs MySQL 5.0.12+, found version %d.', 
mysqli_get_server_version($link)));
+}
 ?>
 --INI--
 default_socket_timeout=10

Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_execute.phpt
===================================================================
--- php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_execute.phpt 2010-05-11 
15:27:03 UTC (rev 299250)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_stmt_execute.phpt 2010-05-11 
15:49:03 UTC (rev 299251)
@@ -5,6 +5,12 @@
 require_once('skipif.inc');
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');
+if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+       die(sprintf('skip Cannot connect to MySQL, [%d] %s.', 
mysqli_connect_errno(), mysqli_connect_error()));
+}
+if (mysqli_get_server_version($link) <= 40100) {
+       die(sprintf('skip Needs MySQL 4.1+, found version %d.', 
mysqli_get_server_version($link)));
+}
 ?>
 --FILE--
 <?php

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

Reply via email to