commit 8aafc1fa317a60341cd66273580418817c9cbb6b 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 7292e9b520d..95a17ad1f3a 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -625,8 +625,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 f9587f4dee5..792d4fbd9eb 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,