mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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
This commit is contained in:
@ -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
|
||||
|
Binary file not shown.
@ -662,4 +662,11 @@ 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
|
||||
|
@ -38,7 +38,6 @@ select load_file(concat(@tmpdir,"/outfile-test.3"));
|
||||
#--error 1086
|
||||
#eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1;
|
||||
#enable_query_log;
|
||||
--error 13,2
|
||||
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
|
||||
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.1
|
||||
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.2
|
||||
|
Reference in New Issue
Block a user