os0file.c:

  Print and error message also if a read from file results in the Linux error EEXIST; may happen if the disk is broken
parent 6b40954a
...@@ -196,7 +196,7 @@ os_file_get_last_error(void) ...@@ -196,7 +196,7 @@ os_file_get_last_error(void)
err = (ulint) GetLastError(); err = (ulint) GetLastError();
if (err != ERROR_FILE_EXISTS && err != ERROR_DISK_FULL) { if (err != ERROR_DISK_FULL) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Operating system error number %li in a file operation.\n" " InnoDB: Operating system error number %li in a file operation.\n"
...@@ -220,6 +220,8 @@ os_file_get_last_error(void) ...@@ -220,6 +220,8 @@ os_file_get_last_error(void)
} }
} }
fflush(stderr);
if (err == ERROR_FILE_NOT_FOUND) { if (err == ERROR_FILE_NOT_FOUND) {
return(OS_FILE_NOT_FOUND); return(OS_FILE_NOT_FOUND);
} else if (err == ERROR_DISK_FULL) { } else if (err == ERROR_DISK_FULL) {
...@@ -232,7 +234,7 @@ os_file_get_last_error(void) ...@@ -232,7 +234,7 @@ os_file_get_last_error(void)
#else #else
err = (ulint) errno; err = (ulint) errno;
if (err != EEXIST && err != ENOSPC ) { if (err != ENOSPC ) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
...@@ -256,6 +258,8 @@ os_file_get_last_error(void) ...@@ -256,6 +258,8 @@ os_file_get_last_error(void)
} }
} }
fflush(stderr);
if (err == ENOSPC ) { if (err == ENOSPC ) {
return(OS_FILE_DISK_FULL); return(OS_FILE_DISK_FULL);
#ifdef POSIX_ASYNC_IO #ifdef POSIX_ASYNC_IO
...@@ -278,7 +282,8 @@ static ...@@ -278,7 +282,8 @@ static
ibool ibool
os_file_handle_error( os_file_handle_error(
/*=================*/ /*=================*/
/* out: TRUE if we should retry the operation */ /* out: TRUE if we should retry the
operation */
os_file_t file, /* in: file pointer */ os_file_t file, /* in: file pointer */
char* name) /* in: name of a file or NULL */ char* name) /* in: name of a file or NULL */
{ {
...@@ -308,12 +313,15 @@ os_file_handle_error( ...@@ -308,12 +313,15 @@ os_file_handle_error(
os_has_said_disk_full = TRUE; os_has_said_disk_full = TRUE;
fflush(stderr);
return(FALSE); return(FALSE);
} else if (err == OS_FILE_AIO_RESOURCES_RESERVED) { } else if (err == OS_FILE_AIO_RESOURCES_RESERVED) {
return(TRUE); return(TRUE);
} else if (err == OS_FILE_ALREADY_EXISTS) { } else if (err == OS_FILE_ALREADY_EXISTS) {
return(FALSE); return(FALSE);
} else { } else {
if (name) { if (name) {
...@@ -322,6 +330,8 @@ os_file_handle_error( ...@@ -322,6 +330,8 @@ os_file_handle_error(
fprintf(stderr, "InnoDB: Cannot continue operation.\n"); fprintf(stderr, "InnoDB: Cannot continue operation.\n");
fflush(stderr);
exit(1); exit(1);
} }
...@@ -1064,6 +1074,16 @@ error_handling: ...@@ -1064,6 +1074,16 @@ error_handling:
goto try_again; goto try_again;
} }
fprintf(stderr,
"InnoDB: Fatal error: cannot read from file. OS error number %lu.\n",
#ifdef __WIN__
(ulint)GetLastError()
#else
(ulint)errno
#endif
);
fflush(stderr);
ut_error; ut_error;
return(FALSE); return(FALSE);
......
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