Skip to content
/ server Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion extra/mariabackup/ds_local.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ local_close(ds_file_t *file)
ret = set_eof(fd);
}

my_close(fd, MYF(MY_WME));
if (my_close(fd, MYF(MY_WME)) != 0)
ret= 1;

my_free(file);
return ret;
}
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/suite/mariabackup/error_during_copyback.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ SELECT * FROM t;
i
1
DROP TABLE t;
#
# MDEV-38562: mariabackup exits with success (0) despite "No space left on device" errors
#
# Simulate close() failure (Disk Full / ENOSPC)
# Verify that "completed OK!" is NOT in the log
NOT FOUND /completed OK!/ in backup.log
# Verify that "FATAL ERROR" is in the log
FOUND 1 /FATAL ERROR/ in backup.log
# End of 10.6 tests
24 changes: 24 additions & 0 deletions mysql-test/suite/mariabackup/error_during_copyback.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,27 @@ SELECT * FROM t;
DROP TABLE t;
rmdir $targetdir;

--echo #
--echo # MDEV-38562: mariabackup exits with success (0) despite "No space left on device" errors
--echo #

--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup

--echo # Simulate close() failure (Disk Full / ENOSPC)
--error 1
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,my_close_fail >$MYSQLTEST_VARDIR/tmp/backup.log 2>&1

--echo # Verify that "completed OK!" is NOT in the log
--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log
--let SEARCH_PATTERN=completed OK!
--source include/search_pattern_in_file.inc

--echo # Verify that "FATAL ERROR" is in the log
--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log
--let SEARCH_PATTERN=FATAL ERROR
--source include/search_pattern_in_file.inc

--remove_file $MYSQLTEST_VARDIR/tmp/backup.log
rmdir $targetdir;

--echo # End of 10.6 tests
3 changes: 3 additions & 0 deletions mysys/my_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ int my_close(File fd, myf MyFlags)
#else
err= my_win_close(fd);
#endif

DBUG_EXECUTE_IF("my_close_fail", { errno=28; err=-1; });

if (err)
{
DBUG_PRINT("error",("Got error %d on close",err));
Expand Down