Skip to content

Commit c084fee

Browse files
committed
Fix show backup mode.
1 parent 7aa2611 commit c084fee

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pg_probackup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ typedef enum BackupStatus
9393

9494
typedef enum BackupMode
9595
{
96-
BACKUP_MODE_INVALID,
96+
BACKUP_MODE_INVALID = 0,
9797
BACKUP_MODE_DIFF_PAGE, /* differential page backup */
9898
BACKUP_MODE_DIFF_PTRACK, /* differential page backup with ptrack system*/
9999
BACKUP_MODE_FULL /* full backup */

show.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ show_backup_list(FILE *out, parray *backup_list)
172172
for (i = 0; i < parray_num(backup_list); i++)
173173
{
174174
pgBackup *backup;
175-
const char *modes[] = { "", "PAGE", "PTRACK", "FULL", "PAGE+STREAM", "PTRACK+STERAM", "FULL+STREAM"};
175+
const char *modes[] = { "", "PAGE", "PTRACK", "FULL", "", "PAGE+STREAM", "PTRACK+STREAM", "FULL+STREAM"};
176176
TimeLineID parent_tli;
177177
char timestamp[20];
178178
char duration[20] = "----";
@@ -196,10 +196,10 @@ show_backup_list(FILE *out, parray *backup_list)
196196
/* Get parent timeline before printing */
197197
parent_tli = get_parent_tli(backup->tli);
198198

199-
fprintf(out, "%-8s %-19s %-12s %2d /%2d %5s %6s %s \n",
199+
fprintf(out, "%-8s %-19s %-13s %2d /%2d %5s %6s %s \n",
200200
base36enc(backup->start_time),
201201
timestamp,
202-
modes[backup->backup_mode*(backup->stream+1)],
202+
modes[backup->backup_mode + (BACKUP_MODE_FULL + 1)*backup->stream],
203203
backup->tli,
204204
parent_tli,
205205
duration,

0 commit comments

Comments
 (0)