From: Georg Richter Date: Fri, 24 Mar 2006 12:10:39 +0000 (+0000) Subject: fix and testcase for bug #36745 X-Git-Tag: php-5.1.3RC2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65d704cb7c655a4be180c741f23d7f7a57a83665;p=php fix and testcase for bug #36745 --- 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-- + +--FILE-- +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