Skip to content

Commit d7d910d

Browse files
committed
Fix a warning about possibly unused variable
xtrabackup_init_temp_log(): Remove a redundant variable and limit scope.
1 parent a988c70 commit d7d910d

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4246,16 +4246,11 @@ xtrabackup_init_temp_log(void)
42464246

42474247
ib_int64_tfile_size;
42484248

4249-
lsn_tmax_no;
4250-
lsn_tmax_lsn;
4251-
lsn_tcheckpoint_no;
4249+
lsn_tmax_no = 0;
4250+
lsn_tmax_lsn = 0;
42524251

42534252
ulint fold;
42544253

4255-
boolcheckpoint_found;
4256-
4257-
max_no = 0;
4258-
42594254
if (!log_buf) {
42604255
goto error;
42614256
}
@@ -4354,35 +4349,29 @@ xtrabackup_init_temp_log(void)
43544349
//' ', 4);
43554350
}
43564351

4357-
checkpoint_found = false;
4358-
43594352
/* read last checkpoint lsn */
43604353
for (field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2;
43614354
field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) {
43624355
if (!recv_check_cp_is_consistent(const_cast<const byte *>
43634356
(log_buf + field)))
4364-
goto not_consistent;
4357+
continue;
43654358

4366-
checkpoint_no = mach_read_from_8(log_buf + field +
4367-
LOG_CHECKPOINT_NO);
4359+
lsn_t checkpoint_no = mach_read_from_8(log_buf + field +
4360+
LOG_CHECKPOINT_NO);
43684361

43694362
if (checkpoint_no >= max_no) {
43704363

43714364
max_no = checkpoint_no;
43724365
max_lsn = mach_read_from_8(log_buf + field +
43734366
LOG_CHECKPOINT_LSN);
4374-
checkpoint_found = true;
43754367
}
4376-
not_consistent:
4377-
;
43784368
}
43794369

4380-
if (!checkpoint_found) {
4370+
if (!max_lsn) {
43814371
msg("mariabackup: No valid checkpoint found.\n");
43824372
goto error;
43834373
}
43844374

4385-
43864375
/* It seems to be needed to overwrite the both checkpoint area. */
43874376
mach_write_to_8(log_buf + LOG_CHECKPOINT_1 + LOG_CHECKPOINT_LSN,
43884377
max_lsn);

0 commit comments

Comments
 (0)