Post MDEV-11902 Fix test failures in maria and myisam storage engines
my_readline can fail due to missing file. Make my_readline report this condition separately so that we can catch it and report an appropriate error message to the user.
This commit is contained in:
parent
1acfa942ed
commit
606a4a4847
@ -5,7 +5,7 @@ Warnings:
|
|||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
create table t1 (a int) engine=myisam;
|
create table t1 (a int) engine=myisam;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
ERROR HY000: Can't find file: './test/t1.MYI' (errno: 20 "Not a directory")
|
ERROR HY000: Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
drop table t1;
|
drop table t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
|
@ -24,9 +24,9 @@ CREATE TABLE t1 (c1 int) ENGINE=MYISAM;
|
|||||||
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
|
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
|
||||||
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
|
||||||
TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT
|
TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT
|
||||||
test t1 BASE TABLE NULL NULL NULL NULL Can't find file: './test/t1.MYI' (errno: 2 "Not a directory")
|
test t1 BASE TABLE NULL NULL NULL NULL Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "Not a directory")
|
Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory")
|
||||||
|
@ -49,7 +49,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo;
|
|||||||
exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo;
|
exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo;
|
||||||
set debug_sync='now SIGNAL run';
|
set debug_sync='now SIGNAL run';
|
||||||
connection default;
|
connection default;
|
||||||
replace_regex / '.*\/tmp\// 'MYSQLTEST_VARDIR\/tmp\// /31/20/;
|
replace_regex / '.*\/test\// '.\/test\// /31/20/;
|
||||||
error ER_FILE_NOT_FOUND;
|
error ER_FILE_NOT_FOUND;
|
||||||
reap;
|
reap;
|
||||||
flush tables;
|
flush tables;
|
||||||
|
@ -129,6 +129,11 @@ int my_is_symlink(const char *filename __attribute__((unused)))
|
|||||||
|
|
||||||
to is guaranteed to never set to a string longer than FN_REFLEN
|
to is guaranteed to never set to a string longer than FN_REFLEN
|
||||||
(including the end \0)
|
(including the end \0)
|
||||||
|
|
||||||
|
On error returns -1, unless error is file not found, in which case it
|
||||||
|
is 1.
|
||||||
|
|
||||||
|
Sets my_errno to specific error number.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int my_realpath(char *to, const char *filename, myf MyFlags)
|
int my_realpath(char *to, const char *filename, myf MyFlags)
|
||||||
@ -154,7 +159,10 @@ int my_realpath(char *to, const char *filename, myf MyFlags)
|
|||||||
if (MyFlags & MY_WME)
|
if (MyFlags & MY_WME)
|
||||||
my_error(EE_REALPATH, MYF(0), filename, my_errno);
|
my_error(EE_REALPATH, MYF(0), filename, my_errno);
|
||||||
my_load_path(to, filename, NullS);
|
my_load_path(to, filename, NullS);
|
||||||
result= -1;
|
if (my_errno == ENOENT)
|
||||||
|
result= 1;
|
||||||
|
else
|
||||||
|
result= -1;
|
||||||
}
|
}
|
||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
|
@ -298,6 +298,11 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
|
|||||||
realpath_err= my_realpath(name_buff, fn_format(org_name, name, "",
|
realpath_err= my_realpath(name_buff, fn_format(org_name, name, "",
|
||||||
MARIA_NAME_IEXT,
|
MARIA_NAME_IEXT,
|
||||||
MY_UNPACK_FILENAME),MYF(0));
|
MY_UNPACK_FILENAME),MYF(0));
|
||||||
|
if (realpath_err > 0) /* File not found, no point in looking further. */
|
||||||
|
{
|
||||||
|
DBUG_RETURN(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (my_is_symlink(org_name) &&
|
if (my_is_symlink(org_name) &&
|
||||||
(realpath_err || mysys_test_invalid_symlink(name_buff)))
|
(realpath_err || mysys_test_invalid_symlink(name_buff)))
|
||||||
{
|
{
|
||||||
|
@ -104,6 +104,11 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
|||||||
|
|
||||||
realpath_err= my_realpath(name_buff,
|
realpath_err= my_realpath(name_buff,
|
||||||
fn_format(org_name,name,"",MI_NAME_IEXT,4),MYF(0));
|
fn_format(org_name,name,"",MI_NAME_IEXT,4),MYF(0));
|
||||||
|
if (realpath_err > 0) /* File not found, no point in looking further. */
|
||||||
|
{
|
||||||
|
DBUG_RETURN(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (my_is_symlink(org_name) &&
|
if (my_is_symlink(org_name) &&
|
||||||
(realpath_err || mysys_test_invalid_symlink(name_buff)))
|
(realpath_err || mysys_test_invalid_symlink(name_buff)))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user