From 40becbc3c7a6555d0a4bb186b4336a2899d5995c Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 2 Jun 2019 16:30:33 +0300 Subject: Fixed bug in online alter table when not compiled with performance schema os_file_write_func() and os_file_read_no_error_handling_func() returned different result values depending on if UNIV_PFS_IO was defined or not. Other things: - Added some comments about return values for some functions --- storage/innobase/include/os0file.h | 4 ++-- storage/innobase/include/os0file.ic | 12 ++++++------ storage/innobase/row/row0merge.cc | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 5be476ff109..324ff99f67b 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1197,12 +1197,12 @@ to original un-instrumented file I/O APIs */ # define os_file_read_no_error_handling(type, file, buf, offset, n, o) \ os_file_read_no_error_handling_func(type, file, buf, offset, n, o) # define os_file_read_no_error_handling_int_fd(type, file, buf, offset, n) \ - os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL) + (os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL) == 0) # define os_file_write(type, name, file, buf, offset, n) \ os_file_write_func(type, name, file, buf, offset, n) # define os_file_write_int_fd(type, name, file, buf, offset, n) \ - os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n) + (os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n) == 0) # define os_file_flush(file) os_file_flush_func(file) diff --git a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.ic index 89eceb77e5f..7a490bf775a 100644 --- a/storage/innobase/include/os0file.ic +++ b/storage/innobase/include/os0file.ic @@ -348,7 +348,7 @@ a synchronous read operation. @param[in] n number of bytes to read @param[in] src_file caller file name @param[in] src_line caller line number -@return whether the request was successful */ +@return 0 on error, 1 on success */ UNIV_INLINE bool pfs_os_file_read_no_error_handling_int_fd_func( @@ -371,14 +371,14 @@ pfs_os_file_read_no_error_handling_int_fd_func( __FILE__, __LINE__); } - bool success = DB_SUCCESS == os_file_read_no_error_handling_func( + bool success = os_file_read_no_error_handling_func( type, OS_FILE_FROM_FD(file), buf, offset, n, NULL); if (locker != NULL) { PSI_FILE_CALL(end_file_wait)(locker, n); } - return(success); + return(success == DB_SUCCESS); // Reverse result } /** NOTE! Please use the corresponding macro os_file_write(), not directly @@ -435,7 +435,7 @@ os_file_write_int_fd() which requests a synchronous write operation. @param[in] n number of bytes @param[in] src_file file name where func invoked @param[in] src_line line where the func invoked -@return whether the request was successful */ +@return 0 on error, 1 on success */ UNIV_INLINE bool pfs_os_file_write_int_fd_func( @@ -459,14 +459,14 @@ pfs_os_file_write_int_fd_func( __FILE__, __LINE__); } - bool success = DB_SUCCESS == os_file_write_func( + bool success = os_file_write_func( type, name, OS_FILE_FROM_FD(file), buf, offset, n); if (locker != NULL) { PSI_FILE_CALL(end_file_wait)(locker, n); } - return(success); + return(success == DB_SUCCESS); // Reverse result } /** NOTE! Please use the corresponding macro os_file_flush(), not directly diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index c7f628339e0..e0c819bea4b 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1115,7 +1115,7 @@ row_merge_read( /********************************************************************//** Write a merge block to the file system. -@return whether the request was completed successfully */ +@return 0 on error, 1 if write succeded */ UNIV_INTERN bool row_merge_write( -- cgit v1.2.1