datibbaw Sun, 04 Sep 2011 14:21:27 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=316108
Log:
Patch to run two more mysql test cases that would usually be skipped.
Replaced skipifdefaultconnectionfailure.inc by three additional ini_set()
statements in connect.inc for the default connection settings
Patch also includes a typo in connect.inc concerning mysql.default_socket
Changed paths:
U php/php-src/branches/PHP_5_3/ext/mysql/tests/connect.inc
U php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_affected_rows.phpt
U php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_insert_id.phpt
D
php/php-src/branches/PHP_5_3/ext/mysql/tests/skipifdefaultconnectfailure.inc
U php/php-src/branches/PHP_5_4/ext/mysql/tests/connect.inc
U php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_affected_rows.phpt
U php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_insert_id.phpt
D
php/php-src/branches/PHP_5_4/ext/mysql/tests/skipifdefaultconnectfailure.inc
U php/php-src/trunk/ext/mysql/tests/connect.inc
U php/php-src/trunk/ext/mysql/tests/mysql_affected_rows.phpt
U php/php-src/trunk/ext/mysql/tests/mysql_insert_id.phpt
D php/php-src/trunk/ext/mysql/tests/skipifdefaultconnectfailure.inc
Modified: php/php-src/branches/PHP_5_3/ext/mysql/tests/connect.inc
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysql/tests/connect.inc 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_3/ext/mysql/tests/connect.inc 2011-09-04 14:21:27 UTC (rev 316108)
@@ -64,13 +64,19 @@
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
+
+// added so that mysql_connect() without args works as well (required in some tests that rely on a default connection being opened implicitly)
+ini_set('mysql.default_host', $host);
+ini_set('mysql.default_user', $user);
+ini_set('mysql.default_password', $passwd);
+
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;
$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true;
$connect_flags = getenv("MYSQL_TEST_CONNECT_FLAGS") ? (int)getenv("MYSQL_TEST_CONNECT_FLAGS") : 0;
if ($socket) {
- ini_set('mysql.default_user', $socket);
+ ini_set('mysql.default_socket', $socket);
}
/* Development setting: test experimal features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?
@@ -78,4 +84,4 @@
false;
$IS_MYSQLND = stristr(mysql_get_client_info(), "mysqlnd");
-?>
\ No newline at end of file
+?>
Modified: php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_affected_rows.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_affected_rows.phpt 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_affected_rows.phpt 2011-09-04 14:21:27 UTC (rev 316108)
@@ -4,7 +4,6 @@
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
Modified: php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_insert_id.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_insert_id.phpt 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_3/ext/mysql/tests/mysql_insert_id.phpt 2011-09-04 14:21:27 UTC (rev 316108)
@@ -4,7 +4,6 @@
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
Deleted: php/php-src/branches/PHP_5_3/ext/mysql/tests/skipifdefaultconnectfailure.inc
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysql/tests/skipifdefaultconnectfailure.inc 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_3/ext/mysql/tests/skipifdefaultconnectfailure.inc 2011-09-04 14:21:27 UTC (rev 316108)
@@ -1,11 +0,0 @@
-<?php
-if ($skip_on_connect_failure) {
- if (!$link = @mysql_connect())
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- if (!@mysql_select_db($db, $link))
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- mysql_close($link);
-}
-?>
Modified: php/php-src/branches/PHP_5_4/ext/mysql/tests/connect.inc
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysql/tests/connect.inc 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_4/ext/mysql/tests/connect.inc 2011-09-04 14:21:27 UTC (rev 316108)
@@ -64,13 +64,19 @@
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
+
+// added so that mysql_connect() without args works as well (required in some tests that rely on a default connection being opened implicitly)
+ini_set('mysql.default_host', $host);
+ini_set('mysql.default_user', $user);
+ini_set('mysql.default_password', $passwd);
+
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;
$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true;
$connect_flags = getenv("MYSQL_TEST_CONNECT_FLAGS") ? (int)getenv("MYSQL_TEST_CONNECT_FLAGS") : 0;
if ($socket) {
- ini_set('mysql.default_user', $socket);
+ ini_set('mysql.default_socket', $socket);
}
/* Development setting: test experimal features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?
@@ -78,4 +84,4 @@
false;
$IS_MYSQLND = stristr(mysql_get_client_info(), "mysqlnd");
-?>
\ No newline at end of file
+?>
Modified: php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_affected_rows.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_affected_rows.phpt 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_affected_rows.phpt 2011-09-04 14:21:27 UTC (rev 316108)
@@ -4,7 +4,6 @@
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
Modified: php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_insert_id.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_insert_id.phpt 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_4/ext/mysql/tests/mysql_insert_id.phpt 2011-09-04 14:21:27 UTC (rev 316108)
@@ -4,7 +4,6 @@
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
Deleted: php/php-src/branches/PHP_5_4/ext/mysql/tests/skipifdefaultconnectfailure.inc
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysql/tests/skipifdefaultconnectfailure.inc 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/branches/PHP_5_4/ext/mysql/tests/skipifdefaultconnectfailure.inc 2011-09-04 14:21:27 UTC (rev 316108)
@@ -1,11 +0,0 @@
-<?php
-if ($skip_on_connect_failure) {
- if (!$link = @mysql_connect())
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- if (!@mysql_select_db($db, $link))
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- mysql_close($link);
-}
-?>
Modified: php/php-src/trunk/ext/mysql/tests/connect.inc
===================================================================
--- php/php-src/trunk/ext/mysql/tests/connect.inc 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/trunk/ext/mysql/tests/connect.inc 2011-09-04 14:21:27 UTC (rev 316108)
@@ -64,13 +64,19 @@
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
+
+// added so that mysql_connect() without args works as well (required in some tests that rely on a default connection being opened implicitly)
+ini_set('mysql.default_host', $host);
+ini_set('mysql.default_user', $user);
+ini_set('mysql.default_password', $passwd);
+
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;
$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true;
$connect_flags = getenv("MYSQL_TEST_CONNECT_FLAGS") ? (int)getenv("MYSQL_TEST_CONNECT_FLAGS") : 0;
if ($socket) {
- ini_set('mysql.default_user', $socket);
+ ini_set('mysql.default_socket', $socket);
}
/* Development setting: test experimal features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?
@@ -78,4 +84,4 @@
false;
$IS_MYSQLND = stristr(mysql_get_client_info(), "mysqlnd");
-?>
\ No newline at end of file
+?>
Modified: php/php-src/trunk/ext/mysql/tests/mysql_affected_rows.phpt
===================================================================
--- php/php-src/trunk/ext/mysql/tests/mysql_affected_rows.phpt 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/trunk/ext/mysql/tests/mysql_affected_rows.phpt 2011-09-04 14:21:27 UTC (rev 316108)
@@ -4,7 +4,6 @@
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
Modified: php/php-src/trunk/ext/mysql/tests/mysql_insert_id.phpt
===================================================================
--- php/php-src/trunk/ext/mysql/tests/mysql_insert_id.phpt 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/trunk/ext/mysql/tests/mysql_insert_id.phpt 2011-09-04 14:21:27 UTC (rev 316108)
@@ -4,7 +4,6 @@
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
-require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
Deleted: php/php-src/trunk/ext/mysql/tests/skipifdefaultconnectfailure.inc
===================================================================
--- php/php-src/trunk/ext/mysql/tests/skipifdefaultconnectfailure.inc 2011-09-04 13:27:19 UTC (rev 316107)
+++ php/php-src/trunk/ext/mysql/tests/skipifdefaultconnectfailure.inc 2011-09-04 14:21:27 UTC (rev 316108)
@@ -1,11 +0,0 @@
-<?php
-if ($skip_on_connect_failure) {
- if (!$link = @mysql_connect())
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- if (!@mysql_select_db($db, $link))
- die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
-
- mysql_close($link);
-}
-?>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php