diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-09-06 22:31:30 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-09-06 22:31:30 +0200 |
commit | b838d081ad346e52787753b1799c627922c4a6c7 (patch) | |
tree | dc8f1e21e6b40d5b72668571c570c9a3214fbf32 /storage/innobase/fil | |
parent | 824db55ce53963a64fcf648b54500df22c57e9b2 (diff) | |
parent | 72c36f4415815d55ddb82b23682f3c549906c00e (diff) | |
download | mariadb-git-b838d081ad346e52787753b1799c627922c4a6c7.tar.gz |
mysql-5.5.33 merge
Diffstat (limited to 'storage/innobase/fil')
-rw-r--r-- | storage/innobase/fil/fil0fil.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index 3e10d45b3a4..3a19a730126 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *****************************************************************************/ @@ -1860,7 +1860,7 @@ fil_write_flushed_lsn_to_data_files( } /*******************************************************************//** -Checks the consistency of the first data page of a data file +Checks the consistency of the first data page of a tablespace at database startup. @retval NULL on success, or if innodb_force_recovery is set @return pointer to an error message string */ @@ -1868,9 +1868,7 @@ static __attribute__((warn_unused_result)) const char* fil_check_first_page( /*=================*/ - const page_t* page, /*!< in: data page */ - ibool first_page) /*!< in: TRUE if this is the - first page of the tablespace */ + const page_t* page) /*!< in: data page */ { ulint space_id; ulint flags; @@ -1882,7 +1880,7 @@ fil_check_first_page( space_id = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_ID + page); flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page); - if (first_page && !space_id && !flags) { + if (!space_id && !flags) { ulint nonzero_bytes = UNIV_PAGE_SIZE; const byte* b = page; @@ -1900,9 +1898,8 @@ fil_check_first_page( return("checksum mismatch"); } - if (!first_page - || (page_get_space_id(page) == space_id - && page_get_page_no(page) == 0)) { + if (page_get_space_id(page) == space_id + && page_get_page_no(page) == 0) { return(NULL); } @@ -1937,7 +1934,7 @@ fil_read_first_page( byte* buf; page_t* page; ib_uint64_t flushed_lsn; - const char* check_msg; + const char* check_msg = NULL; buf = ut_malloc(2 * UNIV_PAGE_SIZE); /* Align the memory for a possible read from a raw device */ @@ -1949,7 +1946,9 @@ fil_read_first_page( flushed_lsn = mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN); - check_msg = fil_check_first_page(page, !one_read_already); + if (!one_read_already) { + check_msg = fil_check_first_page(page); + } ut_free(buf); @@ -3272,7 +3271,7 @@ fil_open_single_table_tablespace( success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE); - check_msg = fil_check_first_page(page, TRUE); + check_msg = fil_check_first_page(page); /* We have to read the tablespace id and flags from the file. */ @@ -3528,7 +3527,7 @@ fil_load_single_table_tablespace( /* We have to read the tablespace id from the file */ - check_msg = fil_check_first_page(page, TRUE); + check_msg = fil_check_first_page(page); if (check_msg) { fprintf(stderr, |