Skip to content

Commit 078d341

Browse files
author
Marina Polyakova
committed
pg_control: fix reading of pg_control of vanilla in pg_controldata
Do not change the CRC as this makes its check senseless. Instead, read the pg_control of vanilla to the pg_control strcucture of vanilla (ControlFileDataOriginal) and print its values as is done in vanilla. Thanks to Arthur Zakirov for reporting this. Also: fix checking of byte ordering mismatch of pg_control in pg_probackup.
1 parent 908efc3 commit 078d341

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ checkControlFile(ControlFileData *ControlFile)
7171
"Either the file is corrupt, or it has a different layout than this program\n"
7272
"is expecting. The results below are untrustworthy.");
7373

74-
if (ControlFile->pg_control_version % 65536 == 0 && ControlFile->pg_control_version / 65536 != 0)
74+
if ((ControlFile->pg_control_version % 65536 == 0 || ControlFile->pg_control_version % 65536 > 10000) &&
75+
ControlFile->pg_control_version / 65536 != 0)
7576
elog(ERROR, "possible byte ordering mismatch\n"
7677
"The byte ordering used to store the pg_control file might not match the one\n"
7778
"used by this program. In that case the results below would be incorrect, and\n"

0 commit comments

Comments
 (0)