From a47bf42d172a35622f5f764e663ea4f83d96c977 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 13 Aug 2022 00:00:41 +0200 Subject: [PATCH] pg_upgrade: Fix some minor code issues 96ef3b8ff1cf1950e897fd2f766d4bd9ef0d5d56 accidentally copied a not applicable comment from the float8_pass_by_value code to the data_checksums code. Remove that. 87d3b35a1ca31a9d947a8f919a6006679216dff0 changed pg_upgrade to checking the checksum version rather than just the Boolean presence of checksums, but didn't change the field type in its ControlData struct from bool. So this would not work correctly if there ever is a checksum version larger than 1. --- src/bin/pg_upgrade/controldata.c | 1 - src/bin/pg_upgrade/pg_upgrade.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c index 1b68e3e872d..5953ef3b662 100644 --- a/src/bin/pg_upgrade/controldata.c +++ b/src/bin/pg_upgrade/controldata.c @@ -493,7 +493,6 @@ get_control_data(ClusterInfo *cluster, bool live_check) pg_fatal("%d: controldata retrieval problem\n", __LINE__); p++; /* remove ':' char */ - /* used later for contrib check */ cluster->controldata.data_checksum_version = str2uint(p); got_data_checksum_version = true; } diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h index f57bedee6c3..eac16679d5b 100644 --- a/src/bin/pg_upgrade/pg_upgrade.h +++ b/src/bin/pg_upgrade/pg_upgrade.h @@ -227,7 +227,7 @@ typedef struct uint32 large_object; bool date_is_int; bool float8_pass_by_value; - bool data_checksum_version; + uint32 data_checksum_version; } ControlData; /*