mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
MDEV-19725 Incorrect error handling in ALTER TABLE
Some I/O functions and macros that are declared in os0file.h used to
return a Boolean status code (nonzero on success). In MySQL 5.7, they
were changed to return dberr_t instead. Alas, in MariaDB Server 10.2,
some uses of functions were not adjusted to the changed return value.
Until MDEV-19231, the valid values of dberr_t were always nonzero.
This means that some code that was incorrectly checking for a zero
return value from the functions would never detect a failure.
After MDEV-19231, some tests for ALTER ONLINE TABLE would fail with
cmake -DPLUGIN_PERFSCHEMA=NO. It turned out that the wrappers
pfs_os_file_read_no_error_handling_int_fd_func() and
pfs_os_file_write_int_fd_func() were wrongly returning
bool instead of dberr_t. Also the callers of these functions were
wrongly expecting bool (nonzero on success) instead of dberr_t.
This mistake had been made when the addition of these functions was
merged from MySQL 5.6.36 and 5.7.18 into MariaDB Server 10.2.7.
This fix also reverts commit 40becbc3c7
which attempted to work around the problem.
This commit is contained in:
parent
5d06edfb26
commit
cbac8f9351
6 changed files with 32 additions and 23 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2009, Percona Inc.
|
||||
Copyright (c) 2013, 2017, MariaDB Corporation.
|
||||
Copyright (c) 2013, 2019, MariaDB Corporation.
|
||||
|
||||
Portions of this file contain modifications contributed and copyrighted
|
||||
by Percona Inc.. Those modifications are
|
||||
|
|
@ -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) == 0)
|
||||
os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL)
|
||||
|
||||
# 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) == 0)
|
||||
os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n)
|
||||
|
||||
# define os_file_flush(file) os_file_flush_func(file)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue