commit 204fd9506b0650ab400533ca1e222d0a700b9bb0 Author: Laurynas Biveinis Date: Tue Jun 6 12:00:33 2017 +0300 Fix bug 80496 / PS-3384 (buf_dblwr_init_or_load_pages now returns an error code, but caller not updated) buf_dblwr_init_or_load_pages, previously a void function, now returns a dberr_t, but its sole caller does not bother to check it. Fix by adding warn_unused_result function attribute and checking the return code in SysTablespace::read_lsn_and_check_flags. diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index ad71b1e51e2..70380ee1ec0 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -531,7 +531,10 @@ dberr_t SysTablespace::read_lsn_and_check_flags(lsn_t *flushed_lsn) { ut_a(it->order() == 0); - buf_dblwr_init_or_load_pages(it->handle(), it->filepath()); + err = buf_dblwr_init_or_load_pages(it->handle(), it->filepath()); + if (err != DB_SUCCESS) { + return (err); + } /* Check the contents of the first page of the first datafile. */ diff --git a/storage/innobase/include/buf0dblwr.h b/storage/innobase/include/buf0dblwr.h index 689edcfc38b..8ffb1b0b7c9 100644 --- a/storage/innobase/include/buf0dblwr.h +++ b/storage/innobase/include/buf0dblwr.h @@ -56,6 +56,7 @@ bool buf_dblwr_create(void); function performs the necessary update operations. If we are in a crash recovery, this function loads the pages from double write buffer into memory. @return DB_SUCCESS or error code */ +MY_ATTRIBUTE((warn_unused_result)) dberr_t buf_dblwr_init_or_load_pages(pfs_os_file_t file, const char *path); /** Process and remove the double write buffer pages for all tablespaces. */