Commit d7d910d0 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix a warning about possibly unused variable

xtrabackup_init_temp_log(): Remove a redundant variable and limit scope.
parent a988c709
...@@ -4246,16 +4246,11 @@ xtrabackup_init_temp_log(void) ...@@ -4246,16 +4246,11 @@ xtrabackup_init_temp_log(void)
ib_int64_t file_size; ib_int64_t file_size;
lsn_t max_no; lsn_t max_no = 0;
lsn_t max_lsn; lsn_t max_lsn = 0;
lsn_t checkpoint_no;
ulint fold; ulint fold;
bool checkpoint_found;
max_no = 0;
if (!log_buf) { if (!log_buf) {
goto error; goto error;
} }
...@@ -4354,16 +4349,14 @@ xtrabackup_init_temp_log(void) ...@@ -4354,16 +4349,14 @@ xtrabackup_init_temp_log(void)
// ' ', 4); // ' ', 4);
} }
checkpoint_found = false;
/* read last checkpoint lsn */ /* read last checkpoint lsn */
for (field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2; for (field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2;
field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) { field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) {
if (!recv_check_cp_is_consistent(const_cast<const byte *> if (!recv_check_cp_is_consistent(const_cast<const byte *>
(log_buf + field))) (log_buf + field)))
goto not_consistent; continue;
checkpoint_no = mach_read_from_8(log_buf + field + lsn_t checkpoint_no = mach_read_from_8(log_buf + field +
LOG_CHECKPOINT_NO); LOG_CHECKPOINT_NO);
if (checkpoint_no >= max_no) { if (checkpoint_no >= max_no) {
...@@ -4371,18 +4364,14 @@ xtrabackup_init_temp_log(void) ...@@ -4371,18 +4364,14 @@ xtrabackup_init_temp_log(void)
max_no = checkpoint_no; max_no = checkpoint_no;
max_lsn = mach_read_from_8(log_buf + field + max_lsn = mach_read_from_8(log_buf + field +
LOG_CHECKPOINT_LSN); LOG_CHECKPOINT_LSN);
checkpoint_found = true;
} }
not_consistent:
;
} }
if (!checkpoint_found) { if (!max_lsn) {
msg("mariabackup: No valid checkpoint found.\n"); msg("mariabackup: No valid checkpoint found.\n");
goto error; goto error;
} }
/* It seems to be needed to overwrite the both checkpoint area. */ /* It seems to be needed to overwrite the both checkpoint area. */
mach_write_to_8(log_buf + LOG_CHECKPOINT_1 + LOG_CHECKPOINT_LSN, mach_write_to_8(log_buf + LOG_CHECKPOINT_1 + LOG_CHECKPOINT_LSN,
max_lsn); max_lsn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment