summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Richter <georg@php.net>2006-03-24 12:10:39 +0000
committerGeorg Richter <georg@php.net>2006-03-24 12:10:39 +0000
commit65d704cb7c655a4be180c741f23d7f7a57a83665 (patch)
tree6b340f576bc83c13a7664001c5c040bde38b776e
parentbf3a7e12e174a12161bcbaad615f2889565c7e30 (diff)
downloadphp-git-65d704cb7c655a4be180c741f23d7f7a57a83665.tar.gz
fix and testcase for bug #36745
-rw-r--r--NEWS2
-rw-r--r--ext/mysqli/mysqli.c1
-rw-r--r--ext/mysqli/tests/bug36745.phpt23
3 files changed, 26 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 6ba0954051..e1a85de627 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,8 @@ PHP NEWS
- Fixed bug #36808 (syslog ident becomes garbage between requests). (Tony)
- Fixed bug #36802 (mysqli_set_charset() crash with a non-open connection).
(Ilia)
+- Fixed bug #36745 (No error message when load data local file isn't found).
+ (Georg)
- Fixed bug #36721 (The SoapServer is not able to send a header that it didn't
receive). (Dmitry)
- Fixed bug #36756 (DOMDocument::removeChild corrupts node). (Rob)
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 4531bb07e2..3e369922c8 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -976,6 +976,7 @@ int php_local_infile_init(void **ptr, const char *filename, void *userdata)
mysql->li_stream = php_stream_open_wrapper_ex((char *)filename, "r", 0, NULL, context);
if (mysql->li_stream == NULL) {
+ sprintf((char *)data->error_msg, "Can't find file '%-.64s'.", filename);
return 1;
}
diff --git a/ext/mysqli/tests/bug36745.phpt b/ext/mysqli/tests/bug36745.phpt
new file mode 100644
index 0000000000..7bbfe8180c
--- /dev/null
+++ b/ext/mysqli/tests/bug36745.phpt
@@ -0,0 +1,23 @@
+--TEST--
+bug #36745 : LOAD DATA LOCAL INFILE doesn't return correct error message
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include ("connect.inc");
+
+ /*** test mysqli_connect 127.0.0.1 ***/
+ $mysql = mysqli_connect($host, $user, $passwd, "test");
+
+ $mysql->query("DROP TABLE IF EXISTS litest");
+ $mysql->query("CREATE TABLE litest (a VARCHAR(20))");
+
+ $mysql->query("LOAD DATA LOCAL INFILE 'filenotfound' INTO TABLE litest");
+ var_dump($mysql->error);
+
+ $mysql->close();
+ printf("Done");
+?>
+--EXPECT--
+string(31) "Can't find file 'filenotfound'."
+Done