summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2019-07-30 18:14:14 +0000
committerHeikki Linnakangas2019-07-30 18:14:49 +0000
commit08e0c08678fa0286c8edaf478c395a6393682fe8 (patch)
tree4f8f8bbcc9cefcbd64602c905589439c8fc8dbc7
parentc3b613e1b0e5a83e36ffb14089bad1d4a5880208 (diff)
Print WAL position correctly in pg_rewind error message.
This has been wrong ever since pg_rewind was added. The if-branch just above this, where we print the same error with an extra message supplied by XLogReadRecord() got this right, but the variable name was wrong in the else-branch. As a consequence, the error printed the WAL position as 0/0 if there was an error reading a WAL file. Backpatch to 9.5, where pg_rewind was added.
-rw-r--r--src/bin/pg_rewind/parsexlog.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c
index b53591d02a1..b431f7b73e8 100644
--- a/src/bin/pg_rewind/parsexlog.c
+++ b/src/bin/pg_rewind/parsexlog.c
@@ -89,8 +89,7 @@ extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex,
errormsg);
else
pg_fatal("could not read WAL record at %X/%X\n",
- (uint32) (startpoint >> 32),
- (uint32) (startpoint));
+ (uint32) (errptr >> 32), (uint32) (errptr));
}
extractPageInfo(xlogreader);