mirror of
https://github.com/postgres/postgres.git
synced 2025-05-17 06:41:24 +03:00
Fix pg_rewind debug output to print the source timeline history
getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source's history was always printed as empty. Spotted while debugging bug #18575, but this does not fix that bug, just the debugging output. Backpatch to all supported versions. Discussion: https://www.postgresql.org/message-id/092dd515-b7b4-4fd0-8407-ceca2f02f6ec@iki.fi
This commit is contained in:
parent
f0096ef13b
commit
c943e2aae7
@ -645,6 +645,7 @@ getTimelineHistory(ControlFileData *controlFile, int *nentries)
|
|||||||
pg_free(histfile);
|
pg_free(histfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* In debugging mode, print what we read */
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -656,10 +657,7 @@ getTimelineHistory(ControlFileData *controlFile, int *nentries)
|
|||||||
else
|
else
|
||||||
Assert(false);
|
Assert(false);
|
||||||
|
|
||||||
/*
|
for (i = 0; i < *nentries; i++)
|
||||||
* Print the target timeline history.
|
|
||||||
*/
|
|
||||||
for (i = 0; i < targetNentries; i++)
|
|
||||||
{
|
{
|
||||||
TimeLineHistoryEntry *entry;
|
TimeLineHistoryEntry *entry;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user