ID: 36745
Updated by: [EMAIL PROTECTED]
Reported By: dweingart at pobox dot com
-Status: Open
+Status: Assigned
Bug Type: MySQLi related
Operating System: Windows XP
PHP Version: 5.1.2
-Assigned To:
+Assigned To: georg
Previous Comments:
------------------------------------------------------------------------
[2006-03-15 16:52:43] dweingart at pobox dot com
Description:
------------
When issuing a LOAD DATA LOCAL INFILE statement, if the file is
missing, mysqli_error() returns the empty string. The same query issued
from the command line client returns the following message:
ERROR:
File '/path/to/nonexistent/file.txt' not found (Errcode: 2)
mysqli_errno returns 2000 (CR_UNKNOWN_ERROR)
Reproduce code:
---------------
<?php
$mysqli = mysqli_init();
$mysqli->options(MYSQLI_OPT_LOCAL_INFILE, 1);
$connect = $mysqli->real_connect('xxx.xxx.xxx.xxx', 'xxxxxxxx',
'xxxxxxxxx', 'mydb');
$query = "
LOAD DATA LOCAL INFILE '/path/to/nonexistent/file.txt'
INTO TABLE mytable
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\r\n'
";
$result = $mysqli->query($query);
var_dump($result, $mysqli->errno, $mysqli->error);
// $result: false
// $mysqli->errno: 2000 (unknown error)
// $mysqli->error: "" (empty string)
?>
Expected result:
----------------
I expect to see an error message similar to the one returned by the
command-line client, or at least a message that gives a clearer idea of
what might have gone wrong.
Actual result:
--------------
Error message is the empty string
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36745&edit=1