Skip to content

Commit e0e24b1

Browse files
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer
- Replaced the pointer parameter of validate_for_recovery() with uint32_t
1 parent cab8f4b commit e0e24b1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,8 @@ fil_ibd_load(
25762576

25772577
/* Read and validate the first page of the tablespace.
25782578
Assign a tablespace name based on the tablespace type. */
2579-
switch (file.validate_for_recovery(&space_id)) {
2579+
switch (file.validate_for_recovery(
2580+
static_cast<uint32_t>(space_id))) {
25802581
os_offset_t minimum_size;
25812582
case DB_SUCCESS:
25822583
deferred_space = file.m_defer;

storage/innobase/fsp/fsp0file.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ reopen it in write mode and ry to restore that page.
391391
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
392392
m_is_valid is also set true on success, else false. */
393393
dberr_t
394-
Datafile::validate_for_recovery(ulint *space_id)
394+
Datafile::validate_for_recovery(uint32_t space_id)
395395
{
396396
dberr_t err;
397397

@@ -438,7 +438,7 @@ Datafile::validate_for_recovery(ulint *space_id)
438438
if (empty_tablespace && space_id) {
439439
/* Set space id to find out whether
440440
the page exist in double write buffer */
441-
m_space_id = *space_id;
441+
m_space_id = space_id;
442442
}
443443

444444
if (restore_from_doublewrite()) {

storage/innobase/include/fsp0file.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class Datafile {
210210
@param space_id space id to validate for recovery
211211
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
212212
m_is_valid is also set true on success, else false. */
213-
dberr_t validate_for_recovery(ulint *space_id=nullptr)
213+
dberr_t validate_for_recovery(uint32_t space_id=0)
214214
MY_ATTRIBUTE((warn_unused_result));
215215

216216
/** Checks the consistency of the first page of a datafile when the

0 commit comments

Comments
 (0)