Minor pg_amcheck fixes spotted while reading code

Started by Daniel Gustafssonabout 5 years ago4 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t44710
psql -h localhost -U postgres

Built from patchset v1 (message #1), September 20, 2026 at 07:51 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t44710_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t44710_1 && git checkout t44710_1

Patchset v1 (message #1) is on t44710_1

Jump to latest
#1Daniel Gustafsson
daniel@yesql.se

When perusing the pg_amcheck code the other day for the recently pushed fixes I
found two small things that seem worth fixing: The help function progname
parameter shadows the global variable of the same name, which no doubt will
make static analyzers complain so we might as well fix that; and there is a
tiny typo in the test stanza.

Both fixed in the attached.

--
Daniel Gustafsson https://vmware.com/

Attachments:

t44710_1
0001-Fix-variable-shadowing.patchapplication/octet-stream; name=0001-Fix-variable-shadowing.patch; x-unix-mode=0644Download+5-6
0002-pg_amcheck-test-typofix.patchapplication/octet-stream; name=0002-pg_amcheck-test-typofix.patch; x-unix-mode=0644Download+1-2
#2Mark Dilger
mark.dilger@enterprisedb.com
In reply to: Daniel Gustafsson (#1)
Re: Minor pg_amcheck fixes spotted while reading code

On Aug 20, 2021, at 11:19 AM, Daniel Gustafsson <daniel@yesql.se> wrote:

When perusing the pg_amcheck code the other day for the recently pushed fixes I
found two small things that seem worth fixing: The help function progname
parameter shadows the global variable of the same name, which no doubt will
make static analyzers complain so we might as well fix that; and there is a
tiny typo in the test stanza.

Both fixed in the attached.

--
Daniel Gustafsson https://vmware.com/

<0001-Fix-variable-shadowing.patch><0002-pg_amcheck-test-typofix.patch>

These look correct.


Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Michael Paquier
michael@paquier.xyz
In reply to: Mark Dilger (#2)
Re: Minor pg_amcheck fixes spotted while reading code

On Fri, Aug 20, 2021 at 11:42:09AM -0700, Mark Dilger wrote:

These look correct.

static void
-help(const char *progname)
+help(const char *program_name)
These were discussed not long ago, and I recall that they were in the
we-don't-care category. Note for example all the tools of
src/scripts/ and pg_dump/.
--
Michael

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Michael Paquier (#3)
Re: Minor pg_amcheck fixes spotted while reading code

On 21 Aug 2021, at 02:43, Michael Paquier <michael@paquier.xyz> wrote:

On Fri, Aug 20, 2021 at 11:42:09AM -0700, Mark Dilger wrote:

These look correct.

static void
-help(const char *progname)
+help(const char *program_name)
These were discussed not long ago, and I recall that they were in the
we-don't-care category. Note for example all the tools of
src/scripts/ and pg_dump/.

Fair enough, I had missed that thread.

--
Daniel Gustafsson https://vmware.com/