From dd934da9159a6eb69fdd7fdd91a78c801a0b7caa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 May 2006 04:37:58 +0200 Subject: [PATCH] Bug#10418: LOAD_FILE does not behave like in manual if file does not exist load_file() string-function should return NULL rather than throw an error if the file doesn't exist, as per the manual. mysql-test/t/outfile.test: expect NULL rather than error if file given to load_file() doesn't exist mysql-test/t/func_str.test: show that load_file() will return NULL rather than throw an error if file doesn't exist mysql-test/r/outfile.result: expect NULL rather than error if file given to load_file() doesn't exist mysql-test/r/func_str.result: expect NULL rather than error if file given to load_file() doesn't exist sql/item_strfunc.cc: load_file() should return NULL as per the docs if file not found, rather than throw an error --- mysql-test/r/func_str.result | 7 +++++++ mysql-test/r/outfile.result | Bin 959 -> 988 bytes mysql-test/t/func_str.test | 9 ++++++++- mysql-test/t/outfile.test | 1 - sql/item_strfunc.cc | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index ae6578795f6..0609624af18 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1000,3 +1000,10 @@ t 1000000 1 drop table t1; +select load_file("lkjlkj"); +load_file("lkjlkj") +NULL +select ifnull(load_file("lkjlkj"),"it's null"); +ifnull(load_file("lkjlkj"),"it's null") +it's null +End of 4.1 tests diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result index 5eb24a78ef0d0242fcdd2f0ad1dfbf47f9d60dac..bcafae831d560242e84f6ab21d5d454deaf87079 100644 GIT binary patch delta 25 hcmdnbeusU-U&e{cG$y}ic_ptr(), mysql_real_data_home, "", MY_RELATIVE_PATH | MY_UNPACK_FILENAME); - if (!my_stat(path, &stat_info, MYF(MY_WME))) + if (!my_stat(path, &stat_info, MYF(0))) goto err; if (!(stat_info.st_mode & S_IROTH))