]> granicus.if.org Git - php/commitdiff
Since we are creating this csv file locally this should obviously
authorRasmus Lerdorf <rasmus@php.net>
Wed, 31 Aug 2011 07:43:58 +0000 (07:43 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 31 Aug 2011 07:43:58 +0000 (07:43 +0000)
be a a LOCAL infile here for this to work reliably. For robustness
this should probably have a check for the local-infile server
setting as well.

ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt

index 37de557527767bb97d63d2b2f869e54228e1cdf6..b550cb8da318447d881e20ad35cb18ca62eaffc6 100644 (file)
@@ -69,7 +69,7 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
                fwrite($fp, b"2;bar");
                fclose($fp);
 
-               $sql = sprintf("LOAD DATA INFILE %s INTO TABLE test FIELDS TERMINATED BY ';' LINES TERMINATED  BY '\n'", $db->quote($filename));
+               $sql = sprintf("LOAD DATA LOCAL INFILE %s INTO TABLE test FIELDS TERMINATED BY ';' LINES TERMINATED  BY '\n'", $db->quote($filename));
 
                if (exec_and_count(4, $db, $sql, 2)) {
 
@@ -105,4 +105,4 @@ $db = MySQLPDOTest::factory();
 $db->exec('DROP TABLE IF EXISTS test');
 ?>
 --EXPECTF--
-done!
\ No newline at end of file
+done!