summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt
diff options
context:
space:
mode:
authorandrey <andrey@php.net>2012-05-03 12:55:03 +0200
committerandrey <andrey@php.net>2012-05-03 12:55:03 +0200
commit522595086b8d654a2fd954977f7f443f2578de22 (patch)
tree468fecc05cffc8da38328979ec9091f88ab142f0 /ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt
parent57f7bd0d858542cfc23a35b9f619137489c873f9 (diff)
downloadphp-git-522595086b8d654a2fd954977f7f443f2578de22.tar.gz
Remove support for local infile handler in mysqli from 5.5
This removes the following functions from the API: mysqli_set_local_infile_default() mysqli_set_local_infile_handler() Using these functions is known to be lead to stability problems in mysqli. It was only enabled when compiling against libmysql. mysqlnd doesn't have this support for local infile. However, with mysqlnd it can be emulated by using stream handlers like in: $c->query("LOAD DATA LOCAL INFILE "http://example.com/import.csv" INTO ...") All available protocols, as well as user implemented ones can be added.
Diffstat (limited to 'ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt')
-rw-r--r--ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt61
1 files changed, 0 insertions, 61 deletions
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
deleted file mode 100644
index 408bb29ec4..0000000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt
+++ /dev/null
@@ -1,61 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - close database link
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
- die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
- die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
- die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
- die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
- require("table.inc");
- require_once('local_infile_tools.inc');
-
- function callback_close_link($fp, &$buffer, $buflen, &$error) {
- global $link;
- static $invocation = 0;
-
- printf("Callback: %d\n", $invocation++);
- flush();
- if (is_object($link))
- mysqli_close($link);
-
- $buffer = "1;'a';\n";
- if ($invocation > 10)
- return 0;
-
- return strlen($buffer);
- }
-
- $file = create_standard_csv(1);
- $expected = array(array('id' => 1, 'label' => 'a'));
- try_handler(20, $link, $file, 'callback_close_link', $expected);
- mysqli_close($link);
- print "done!";
-?>
---CLEAN--
-<?php
- require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_close_link'
-Callback: 0
-done! \ No newline at end of file