summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-12-01 13:37:06 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-12-01 13:37:06 +0530
commite0e24b180d090d7ee378c097ab02df891b61a965 (patch)
tree08dbba973cfa5301fc9661fb4d1b96b034556068
parentcab8f4b552d234c8642f87fae28ecb098392c381 (diff)
downloadmariadb-git-e0e24b180d090d7ee378c097ab02df891b61a965.tar.gz
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite bufferbb-10.6-MDEV-27014
- Replaced the pointer parameter of validate_for_recovery() with uint32_t
-rw-r--r--storage/innobase/fil/fil0fil.cc3
-rw-r--r--storage/innobase/fsp/fsp0file.cc4
-rw-r--r--storage/innobase/include/fsp0file.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 00ee1c71981..1bedcb56077 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -2576,7 +2576,8 @@ fil_ibd_load(
/* Read and validate the first page of the tablespace.
Assign a tablespace name based on the tablespace type. */
- switch (file.validate_for_recovery(&space_id)) {
+ switch (file.validate_for_recovery(
+ static_cast<uint32_t>(space_id))) {
os_offset_t minimum_size;
case DB_SUCCESS:
deferred_space = file.m_defer;
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index fbf87843550..2ea4a3a85ca 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -391,7 +391,7 @@ reopen it in write mode and ry to restore that page.
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
m_is_valid is also set true on success, else false. */
dberr_t
-Datafile::validate_for_recovery(ulint *space_id)
+Datafile::validate_for_recovery(uint32_t space_id)
{
dberr_t err;
@@ -438,7 +438,7 @@ Datafile::validate_for_recovery(ulint *space_id)
if (empty_tablespace && space_id) {
/* Set space id to find out whether
the page exist in double write buffer */
- m_space_id = *space_id;
+ m_space_id = space_id;
}
if (restore_from_doublewrite()) {
diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h
index 5978e2d0576..d87134d2913 100644
--- a/storage/innobase/include/fsp0file.h
+++ b/storage/innobase/include/fsp0file.h
@@ -210,7 +210,7 @@ public:
@param space_id space id to validate for recovery
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
m_is_valid is also set true on success, else false. */
- dberr_t validate_for_recovery(ulint *space_id=nullptr)
+ dberr_t validate_for_recovery(uint32_t space_id=0)
MY_ATTRIBUTE((warn_unused_result));
/** Checks the consistency of the first page of a datafile when the