public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: pgsql-hackers <[email protected]>
Subject: pg_basebackup: Correct type of WalSegSz
Date: Thu, 30 Mar 2023 08:24:36 +0200
Message-ID: <[email protected]> (raw)

The pg_basebackup code has WalSegSz as uint32, whereas the rest of the 
code has it as int.  This seems confusing, and using the extra range 
wouldn't actually work.  This was in the original commit (fc49e24fa6), 
but I suppose it was an oversight.
From 43c6b03b0d2cc044989de7722b8fd7b136fded7b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 30 Mar 2023 08:19:04 +0200
Subject: [PATCH] pg_basebackup: Correct type of WalSegSz

The pg_basebackup code had WalSegSz as uint32, whereas the rest of the
code has it as int.  This seems confusing, and using the extra range
wouldn't actually work.
---
 src/bin/pg_basebackup/streamutil.c | 2 +-
 src/bin/pg_basebackup/streamutil.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index e7618f4617..15514599c4 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -31,7 +31,7 @@
 
 #define ERRCODE_DUPLICATE_OBJECT  "42710"
 
-uint32		WalSegSz;
+int			WalSegSz;
 
 static bool RetrieveDataDirCreatePerm(PGconn *conn);
 
diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h
index 04ceb30971..268c163213 100644
--- a/src/bin/pg_basebackup/streamutil.h
+++ b/src/bin/pg_basebackup/streamutil.h
@@ -24,7 +24,7 @@ extern char *dbuser;
 extern char *dbport;
 extern char *dbname;
 extern int	dbgetpassword;
-extern uint32 WalSegSz;
+extern int	WalSegSz;
 
 /* Connection kept global so we can disconnect easily */
 extern PGconn *conn;
-- 
2.40.0



Attachments:

  [text/plain] 0001-pg_basebackup-Correct-type-of-WalSegSz.patch (1.3K, ../[email protected]/2-0001-pg_basebackup-Correct-type-of-WalSegSz.patch)
  download | inline diff:
From 43c6b03b0d2cc044989de7722b8fd7b136fded7b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 30 Mar 2023 08:19:04 +0200
Subject: [PATCH] pg_basebackup: Correct type of WalSegSz

The pg_basebackup code had WalSegSz as uint32, whereas the rest of the
code has it as int.  This seems confusing, and using the extra range
wouldn't actually work.
---
 src/bin/pg_basebackup/streamutil.c | 2 +-
 src/bin/pg_basebackup/streamutil.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index e7618f4617..15514599c4 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -31,7 +31,7 @@
 
 #define ERRCODE_DUPLICATE_OBJECT  "42710"
 
-uint32		WalSegSz;
+int			WalSegSz;
 
 static bool RetrieveDataDirCreatePerm(PGconn *conn);
 
diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h
index 04ceb30971..268c163213 100644
--- a/src/bin/pg_basebackup/streamutil.h
+++ b/src/bin/pg_basebackup/streamutil.h
@@ -24,7 +24,7 @@ extern char *dbuser;
 extern char *dbport;
 extern char *dbname;
 extern int	dbgetpassword;
-extern uint32 WalSegSz;
+extern int	WalSegSz;
 
 /* Connection kept global so we can disconnect easily */
 extern PGconn *conn;
-- 
2.40.0



view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: pg_basebackup: Correct type of WalSegSz
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox