pg_upgrade: Fix some minor code issues
authorPeter Eisentraut <[email protected]>
Fri, 12 Aug 2022 22:00:41 +0000 (00:00 +0200)
committerPeter Eisentraut <[email protected]>
Fri, 12 Aug 2022 22:00:41 +0000 (00:00 +0200)
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
src/bin/pg_upgrade/pg_upgrade.h

index 07de9183588c34f4dffe7389d849e98d1db148f8..e2086a07dea4b250d7e8ddc95b76526d1ba5a293 100644 (file)
@@ -497,7 +497,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
                                pg_fatal("%d: controldata retrieval problem", __LINE__);
 
                        p++;                            /* remove ':' char */
-                       /* used later for contrib check */
                        cluster->controldata.data_checksum_version = str2uint(p);
                        got_data_checksum_version = true;
                }
index 728908b1a09cabc2a1dddeddbc5b792b06bd595b..60c3c8dd68e103502de05a9a6441d743e7751e90 100644 (file)
@@ -216,7 +216,7 @@ typedef struct
        uint32          large_object;
        bool            date_is_int;
        bool            float8_pass_by_value;
-       bool            data_checksum_version;
+       uint32          data_checksum_version;
 } ControlData;
 
 /*