diff options
author | Nirbhay Choubey <nirbhay@skysql.com> | 2014-08-11 23:55:41 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@skysql.com> | 2014-08-11 23:55:41 -0400 |
commit | 8358dd53b7406deaa9f50ad09b16a86b7e367632 (patch) | |
tree | ef8995ad0e400cb6a1842649c3c886c7b3474835 /storage/innobase/os | |
parent | e06e12f5b8dfe0ab2e5976eec1b27b25d318441b (diff) | |
parent | 4105cbf4a230c82ea7dee31d4d2262b798fad9f4 (diff) | |
download | mariadb-git-8358dd53b7406deaa9f50ad09b16a86b7e367632.tar.gz |
bzr merge -r4346 maria/10.0 (maria-10.0.13)
Diffstat (limited to 'storage/innobase/os')
-rw-r--r-- | storage/innobase/os/os0file.cc | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 992b1e79b58..1ec08da8a83 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2679,7 +2679,7 @@ try_again: } ib_logf(IB_LOG_LEVEL_ERROR, - "Tried to read "ULINTPF" bytes at offset " UINT64PF". " + "Tried to read " ULINTPF " bytes at offset " UINT64PF ". " "Was only able to read %ld.", n, offset, (lint) ret); #endif /* __WIN__ */ #ifdef __WIN__ @@ -2866,6 +2866,7 @@ os_file_write_func( DWORD high; ulint n_retries = 0; ulint err; + DWORD saved_error = 0; #ifndef UNIV_HOTBACKUP ulint i; #endif /* !UNIV_HOTBACKUP */ @@ -2955,8 +2956,10 @@ retry: } if (!os_has_said_disk_full) { + char *winmsg = NULL; - err = (ulint) GetLastError(); + saved_error = GetLastError(); + err = (ulint) saved_error; ut_print_timestamp(stderr); @@ -2973,6 +2976,23 @@ retry: name, offset, (ulong) n, (ulong) len, (ulong) err); + /* Ask Windows to prepare a standard message for a + GetLastError() */ + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, saved_error, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&winmsg, 0, NULL); + + if (winmsg) { + fprintf(stderr, + "InnoDB: FormatMessage: Error number %lu means '%s'.\n", + (ulong) saved_error, winmsg); + LocalFree(winmsg); + } + if (strerror((int) err) != NULL) { fprintf(stderr, "InnoDB: Error number %lu means '%s'.\n", @@ -3001,12 +3021,11 @@ retry: } if (!os_has_said_disk_full) { - ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error: Write to file %s failed" - " at offset "UINT64PF".\n" + " at offset " UINT64PF ".\n" "InnoDB: %lu bytes should have been written," " only %ld were written.\n" "InnoDB: Operating system error number %lu.\n" @@ -4592,11 +4611,16 @@ os_aio_func( wake_later = mode & OS_AIO_SIMULATED_WAKE_LATER; mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER); + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", + mode = OS_AIO_SYNC;); + if (mode == OS_AIO_SYNC #ifdef WIN_ASYNC_IO && !srv_use_native_aio #endif /* WIN_ASYNC_IO */ ) { + ibool ret; + /* This is actually an ordinary synchronous read or write: no need to use an i/o-handler thread. NOTE that if we use Windows async i/o, Windows does not allow us to use @@ -4611,13 +4635,23 @@ os_aio_func( and os_file_write_func() */ if (type == OS_FILE_READ) { - return(os_file_read_func(file, buf, offset, n)); + ret = os_file_read_func(file, buf, offset, n); + } else { + + ut_ad(!srv_read_only_mode); + ut_a(type == OS_FILE_WRITE); + + ret = os_file_write_func(name, file, buf, offset, n); } - ut_ad(!srv_read_only_mode); - ut_a(type == OS_FILE_WRITE); + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", + os_has_said_disk_full = FALSE;); + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", + ret = 0;); + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", + errno = 28;); - return(os_file_write_func(name, file, buf, offset, n)); + return ret; } try_again: @@ -5442,7 +5476,13 @@ consecutive_loop: aio_slot->offset, total_len); } - ut_a(ret); + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", + os_has_said_disk_full = FALSE;); + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", + ret = 0;); + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", + errno = 28;); + srv_set_io_thread_op_info(global_segment, "file i/o done"); if (aio_slot->type == OS_FILE_READ && n_consecutive > 1) { |