commit 0871c4b2b6b4d69017bb32b143750b25e0d518da Author: Laurynas Biveinis Date: Tue Jun 6 12:00:33 2017 +0300 Fix bug 80496 / 1549301 (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 3d36c6d7763..da0b35c9236 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -549,8 +549,10 @@ 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 0957a464812..5c7870ae0a0 100644 --- a/storage/innobase/include/buf0dblwr.h +++ b/storage/innobase/include/buf0dblwr.h @@ -55,6 +55,7 @@ upgrading to an InnoDB version which supports multiple tablespaces, then this 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,