Commit a4f1df82 authored by unknown's avatar unknown

Merge mysql.com:/home/mysql-4.1-10418

into  mysql.com:/home/mysql-5.0-10418


mysql-test/t/outfile.test:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
mysql-test/r/func_str.result:
  expect NULL rather than error if file given to load_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/t/func_str.test:
  show that load_file() will return NULL rather than throw an error
  if file doesn't exist
parents a37955d0 d21445c2
......@@ -1017,6 +1017,13 @@ 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
create table t1 (d decimal default null);
insert into t1 values (null);
select format(d, 2) from t1;
......
......@@ -666,7 +666,14 @@ select rpad(i, 7, ' ') as t from t1;
--disable_metadata
drop table t1;
# End of 4.1 tests
#
# Bug #10418: LOAD_FILE does not behave like in manual if file does not exist
#
select load_file("lkjlkj");
select ifnull(load_file("lkjlkj"),"it's null");
--echo End of 4.1 tests
#
# Bug #13361: SELECT FORMAT(<decimal field with null>, 2) crashes
......
......@@ -40,7 +40,6 @@ eval select * into dumpfile "../tmp/outfile-test.2" from t1;
--error 1086
eval select * into dumpfile "../tmp/outfile-test.3" from t1;
enable_query_log;
--error 13,2
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.1
--exec rm $MYSQLTEST_VARDIR/tmp/outfile-test.2
......
......@@ -2579,7 +2579,7 @@ String *Item_load_file::val_str(String *str)
(void) fn_format(path, file_name->c_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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment