Skip to content

Commit 40becbc

Browse files
committed
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
1 parent 1bfa7ce commit 40becbc

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

storage/innobase/include/os0file.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,12 +1197,12 @@ to original un-instrumented file I/O APIs */
11971197
# define os_file_read_no_error_handling(type, file, buf, offset, n, o) \
11981198
os_file_read_no_error_handling_func(type, file, buf, offset, n, o)
11991199
# define os_file_read_no_error_handling_int_fd(type, file, buf, offset, n) \
1200-
os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL)
1200+
(os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL) == 0)
12011201

12021202
# define os_file_write(type, name, file, buf, offset, n) \
12031203
os_file_write_func(type, name, file, buf, offset, n)
12041204
# define os_file_write_int_fd(type, name, file, buf, offset, n) \
1205-
os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n)
1205+
(os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n) == 0)
12061206

12071207
# define os_file_flush(file) os_file_flush_func(file)
12081208

storage/innobase/include/os0file.ic

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ a synchronous read operation.
348348
@param[in] n number of bytes to read
349349
@param[in] src_file caller file name
350350
@param[in] src_line caller line number
351-
@return whether the request was successful */
351+
@return 0 on error, 1 on success */
352352
UNIV_INLINE
353353
bool
354354
pfs_os_file_read_no_error_handling_int_fd_func(
@@ -371,14 +371,14 @@ pfs_os_file_read_no_error_handling_int_fd_func(
371371
__FILE__, __LINE__);
372372
}
373373

374-
bool success = DB_SUCCESS == os_file_read_no_error_handling_func(
374+
bool success = os_file_read_no_error_handling_func(
375375
type, OS_FILE_FROM_FD(file), buf, offset, n, NULL);
376376

377377
if (locker != NULL) {
378378
PSI_FILE_CALL(end_file_wait)(locker, n);
379379
}
380380

381-
return(success);
381+
return(success == DB_SUCCESS); // Reverse result
382382
}
383383

384384
/** 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.
435435
@param[in] n number of bytes
436436
@param[in] src_file file name where func invoked
437437
@param[in] src_line line where the func invoked
438-
@return whether the request was successful */
438+
@return 0 on error, 1 on success */
439439
UNIV_INLINE
440440
bool
441441
pfs_os_file_write_int_fd_func(
@@ -459,14 +459,14 @@ pfs_os_file_write_int_fd_func(
459459
__FILE__, __LINE__);
460460
}
461461

462-
bool success = DB_SUCCESS == os_file_write_func(
462+
bool success = os_file_write_func(
463463
type, name, OS_FILE_FROM_FD(file), buf, offset, n);
464464

465465
if (locker != NULL) {
466466
PSI_FILE_CALL(end_file_wait)(locker, n);
467467
}
468468

469-
return(success);
469+
return(success == DB_SUCCESS); // Reverse result
470470
}
471471

472472
/** NOTE! Please use the corresponding macro os_file_flush(), not directly

storage/innobase/row/row0merge.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ row_merge_read(
11151115

11161116
/********************************************************************//**
11171117
Write a merge block to the file system.
1118-
@return whether the request was completed successfully */
1118+
@return 0 on error, 1 if write succeded */
11191119
UNIV_INTERN
11201120
bool
11211121
row_merge_write(

0 commit comments

Comments
 (0)