Commit 40becbc3 authored by Monty's avatar Monty

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
parent 1bfa7ceb
...@@ -1197,12 +1197,12 @@ to original un-instrumented file I/O APIs */ ...@@ -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) \ # 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) 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) \ # 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) \ # define os_file_write(type, name, file, buf, offset, n) \
os_file_write_func(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) \ # 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) # define os_file_flush(file) os_file_flush_func(file)
......
...@@ -348,7 +348,7 @@ a synchronous read operation. ...@@ -348,7 +348,7 @@ a synchronous read operation.
@param[in] n number of bytes to read @param[in] n number of bytes to read
@param[in] src_file caller file name @param[in] src_file caller file name
@param[in] src_line caller line number @param[in] src_line caller line number
@return whether the request was successful */ @return 0 on error, 1 on success */
UNIV_INLINE UNIV_INLINE
bool bool
pfs_os_file_read_no_error_handling_int_fd_func( pfs_os_file_read_no_error_handling_int_fd_func(
...@@ -371,14 +371,14 @@ 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__); __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); type, OS_FILE_FROM_FD(file), buf, offset, n, NULL);
if (locker != NULL) { if (locker != NULL) {
PSI_FILE_CALL(end_file_wait)(locker, n); 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 /** 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. ...@@ -435,7 +435,7 @@ os_file_write_int_fd() which requests a synchronous write operation.
@param[in] n number of bytes @param[in] n number of bytes
@param[in] src_file file name where func invoked @param[in] src_file file name where func invoked
@param[in] src_line line where the 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 UNIV_INLINE
bool bool
pfs_os_file_write_int_fd_func( pfs_os_file_write_int_fd_func(
...@@ -459,14 +459,14 @@ pfs_os_file_write_int_fd_func( ...@@ -459,14 +459,14 @@ pfs_os_file_write_int_fd_func(
__FILE__, __LINE__); __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); type, name, OS_FILE_FROM_FD(file), buf, offset, n);
if (locker != NULL) { if (locker != NULL) {
PSI_FILE_CALL(end_file_wait)(locker, n); 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 /** NOTE! Please use the corresponding macro os_file_flush(), not directly
......
...@@ -1115,7 +1115,7 @@ row_merge_read( ...@@ -1115,7 +1115,7 @@ row_merge_read(
/********************************************************************//** /********************************************************************//**
Write a merge block to the file system. 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 UNIV_INTERN
bool bool
row_merge_write( row_merge_write(
......
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