From: Ulf Wendel Date: Tue, 20 Oct 2009 12:31:04 +0000 (+0000) Subject: Fixing typo in SKIPIF and partly skipping tests if using remote MySQL because LOAD... X-Git-Tag: php-5.3.2RC1~333 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57c1b63c2d46156a71791531eac0665866da9348;p=php Fixing typo in SKIPIF and partly skipping tests if using remote MySQL because LOAD LOCAL INFILE will fail --- diff --git a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt index 577ede3752..4e3bfbcf39 100644 --- a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt +++ b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt @@ -13,6 +13,14 @@ if (!$fp = fopen('./simple.csv', 'w')) fclose($fp); @unlink('./simple.csv'); + +require_once("connect.inc"); +if ($socket == "" && $host != NULL && $host != 'localhost' && $host != '.') { + /* could be a remote TCP/IP connection. LOCAL INFILE may not work */ + if (gethostbyaddr($host) != gethostname()) { + die("skip LOAD DATA LOCAL INFILE will fail if connecting to remote MySQL"); + } +} ?> --INI-- safe_mode=0 diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler.phpt index 5cb1459d85..c8da0183be 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler.phpt @@ -10,7 +10,7 @@ if (!function_exists('mysqli_set_local_infile_handler')) die("skip - function not available."); require_once('connect.inc'); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt index ec097fe2b6..ad0a3532f9 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt @@ -13,7 +13,7 @@ if (!function_exists('mysqli_set_local_infile_handler')) if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt index 03f4288825..e7df96e5a4 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt index d5fd236013..c2ee87b34a 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt index a2e6c57ad7..4ebf8ded2e 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt index 7e24458890..3d94a545d9 100755 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt index d3b56ebb49..09b4f90f6c 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt @@ -10,7 +10,7 @@ if (!function_exists('mysqli_set_local_infile_handler')) die("skip - function not available."); require_once('connect.inc'); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt index 30a3bcc035..ca42705494 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt index 465dcdb9d6..8b56deafac 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt index 5ea82e93f2..1c47292e3b 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt index 6354630c08..6113abae67 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt index c30f6ea916..423ad834e6 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt @@ -10,7 +10,7 @@ if (!function_exists('mysqli_set_local_infile_handler')) die("skip - function not available."); require_once('connect.inc'); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt index cde8f4b129..33dd5164ec 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt index a793ac6623..9af9974e71 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt @@ -13,7 +13,7 @@ require_once('connect.inc'); if (!$TEST_EXPERIMENTAL) die("skip - experimental (= unsupported) feature"); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) { diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt index c89fc2152c..e6dfecb7eb 100644 --- a/ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt +++ b/ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt @@ -10,7 +10,7 @@ if (!function_exists('mysqli_set_local_infile_handler')) die("skip - function not available."); require_once('connect.inc'); -if (!$link = my_mysqli_connect($host, $user, $passwb, $db, $port, $socket)) +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip Cannot connect to MySQL"); if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) {