mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Fix a warning about possibly unused variable
xtrabackup_init_temp_log(): Remove a redundant variable and limit scope.
This commit is contained in:
parent
a988c70922
commit
d7d910d08b
1 changed files with 6 additions and 17 deletions
|
@ -4246,16 +4246,11 @@ xtrabackup_init_temp_log(void)
|
|||
|
||||
ib_int64_t file_size;
|
||||
|
||||
lsn_t max_no;
|
||||
lsn_t max_lsn;
|
||||
lsn_t checkpoint_no;
|
||||
lsn_t max_no = 0;
|
||||
lsn_t max_lsn = 0;
|
||||
|
||||
ulint fold;
|
||||
|
||||
bool checkpoint_found;
|
||||
|
||||
max_no = 0;
|
||||
|
||||
if (!log_buf) {
|
||||
goto error;
|
||||
}
|
||||
|
@ -4354,35 +4349,29 @@ retry:
|
|||
// ' ', 4);
|
||||
}
|
||||
|
||||
checkpoint_found = false;
|
||||
|
||||
/* read last checkpoint lsn */
|
||||
for (field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2;
|
||||
field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) {
|
||||
if (!recv_check_cp_is_consistent(const_cast<const byte *>
|
||||
(log_buf + field)))
|
||||
goto not_consistent;
|
||||
continue;
|
||||
|
||||
checkpoint_no = mach_read_from_8(log_buf + field +
|
||||
LOG_CHECKPOINT_NO);
|
||||
lsn_t checkpoint_no = mach_read_from_8(log_buf + field +
|
||||
LOG_CHECKPOINT_NO);
|
||||
|
||||
if (checkpoint_no >= max_no) {
|
||||
|
||||
max_no = checkpoint_no;
|
||||
max_lsn = mach_read_from_8(log_buf + field +
|
||||
LOG_CHECKPOINT_LSN);
|
||||
checkpoint_found = true;
|
||||
}
|
||||
not_consistent:
|
||||
;
|
||||
}
|
||||
|
||||
if (!checkpoint_found) {
|
||||
if (!max_lsn) {
|
||||
msg("mariabackup: No valid checkpoint found.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
/* It seems to be needed to overwrite the both checkpoint area. */
|
||||
mach_write_to_8(log_buf + LOG_CHECKPOINT_1 + LOG_CHECKPOINT_LSN,
|
||||
max_lsn);
|
||||
|
|
Loading…
Reference in a new issue