aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2023-08-24 14:37:29 +0530
committerAmit Kapila <akapila@postgresql.org>2023-08-24 14:37:29 +0530
commit27449ccc4d3a6ee77cbd13bed65f8fbea49486c1 (patch)
treef50f40361dd55be643432bc333d342754ae8e468 /src
parent9efcf442b9a4035be2692525be81a23224288d1b (diff)
downloadpostgresql-27449ccc4d3a6ee77cbd13bed65f8fbea49486c1.tar.gz
postgresql-27449ccc4d3a6ee77cbd13bed65f8fbea49486c1.zip
Fix the error message when failing to restore the snapshot.
The SnapBuildRestoreContents() used a const value in the error message to indicate the size in bytes it was expecting to read from the serialized snapshot file. Fix it by reporting the size that was actually passed. Author: Hou Zhijie Reviewed-by: Amit Kapila Backpatch-through: 16 Discussion: http://postgr.es/m/OS0PR01MB5716D408364F7DF32221C08D941FA@OS0PR01MB5716.jpnprd01.prod.outlook.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/logical/snapbuild.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 843ceba840b..fec190a8b2f 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -2039,7 +2039,7 @@ SnapBuildRestoreContents(int fd, char *dest, Size size, const char *path)
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
errmsg("could not read file \"%s\": read %d of %zu",
- path, readBytes, sizeof(SnapBuild))));
+ path, readBytes, size)));
}
}