Re: correct the sizes of values and nulls arrays in pg_control_checkpoint

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: correct the sizes of values and nulls arrays in pg_control_checkpoint
Date: 2021-12-26 00:20:00
Message-ID: 20211226002000.GI17618@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 23, 2021 at 05:09:28PM +0530, Bharath Rupireddy wrote:
> Hi,
>
> pg_control_checkpoint emits 18 columns whereas the values and nulls
> arrays are defined to be of size 19. Although it's not critical,
> attaching a tiny patch to fix this.

LGTM

It's helpful to check the history to find where the error was introduced:

4b0d28de06b28e57c540fca458e4853854fbeaf8
2ede45c3a49e484edfa143850d55eb32dba296de

> diff --git a/src/backend/utils/misc/pg_controldata.c
> b/src/backend/utils/misc/pg_controldata.c
> index 209a20a882..b1db9a8d07 100644
> --- a/src/backend/utils/misc/pg_controldata.c
> +++ b/src/backend/utils/misc/pg_controldata.c
> @@ -79,8 +79,8 @@ pg_control_system(PG_FUNCTION_ARGS)
> Datum
> pg_control_checkpoint(PG_FUNCTION_ARGS)
> {
> - Datum values[19];
> - bool nulls[19];
> + Datum values[18];
> + bool nulls[18];
> TupleDesc tupdesc;
> HeapTuple htup;
> ControlFileData *ControlFile;

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-12-26 00:20:54 Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display
Previous Message SATYANARAYANA NARLAPURAM 2021-12-25 22:22:42 Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes