summaryrefslogtreecommitdiff
path: root/ext/mysql/tests
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-03-26 16:58:25 +0000
committerAndrey Hristov <andrey@php.net>2010-03-26 16:58:25 +0000
commit7868bca437431f95f4b51afa3e4c4b64e45ebad9 (patch)
tree74522e929e144647f36110a6036be47843d46ca1 /ext/mysql/tests
parenta2edb7f69c30fbc2cee6f0a4af94226b198ec558 (diff)
downloadphp-git-7868bca437431f95f4b51afa3e4c4b64e45ebad9.tar.gz
Fix tests that fail when the MySQL's socket file is not /tmp/mysql.sock
as it is in when compiled from source and the default for mysqlnd. SuSE for example uses /var/run/mysql/mysql.sock . Also, sql.safe_mode (ext/mysql and ingres) needs the socket. Fix possible crashes in mysqlnd. When packets are shorter, functions should return error.
Diffstat (limited to 'ext/mysql/tests')
-rwxr-xr-xext/mysql/tests/connect.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mysql/tests/connect.inc b/ext/mysql/tests/connect.inc
index b5cc03ecb4..97fed42146 100755
--- a/ext/mysql/tests/connect.inc
+++ b/ext/mysql/tests/connect.inc
@@ -69,7 +69,9 @@ $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);
+}
/* Development setting: test experimal features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?
((1 == getenv("MYSQL_TEST_EXPERIMENTAL")) ? true : false) :