Re: brin: Remove duplicate initialization in initialize_brin_buildstate() - Mailing list pgsql-hackers

From Shinya Kato
Subject Re: brin: Remove duplicate initialization in initialize_brin_buildstate()
Date
Msg-id CAOzEurT07FUyHnxpY=CXia2z3eto1APA4RpE=zhb7=-tmhHGPg@mail.gmail.com
Whole thread
In response to brin: Remove duplicate initialization in initialize_brin_buildstate()  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: brin: Remove duplicate initialization in initialize_brin_buildstate()
List pgsql-hackers
On Wed, Jan 21, 2026 at 3:30 PM Chao Li <li.evan.chao@gmail.com> wrote:
>
> Hi Hacker,
>
> Just noticed a redundant assignment in initialize_brin_buildstate():
>
> ```
> static BrinBuildState *
> initialize_brin_buildstate(Relation idxRel, BrinRevmap *revmap,
>   BlockNumber pagesPerRange, BlockNumber tablePages)
> {
> BrinBuildState *state;
> BlockNumber lastRange = 0;
>
> state = palloc_object(BrinBuildState);
>
>         <…omit some lines…>
>
> // Later, b437571 added the same again. This patch deletes these 3 lines.
> state->bs_context = CurrentMemoryContext;
> state->bs_emptyTuple = NULL;
> state->bs_emptyTupleLen = 0;
>
> // Added by dae761a first
> /* Remember the memory context to use for an empty tuple, if needed. */
> state->bs_context = CurrentMemoryContext;
> state->bs_emptyTuple = NULL;
> state->bs_emptyTupleLen = 0;
> ```
>
> So, filing a trivial patch to eliminate the redundancy.

Thank you for the patch! It looks good to me, so I’ve marked the entry
as Ready for Committer.

--
Best regards,
Shinya Kato
NTT OSS Center



pgsql-hackers by date:

Previous
From: "Jelte Fennema-Nio"
Date:
Subject: Re: Extension security improvement: Add support for extensions with an owned schema
Next
From: Henson Choi
Date:
Subject: Re: Row pattern recognition