brin: Remove duplicate initialization in initialize_brin_buildstate()
Chao Li <li.evan.chao@gmail.com>
From: Chao Li <li.evan.chao@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-21T06:29:54Z
Lists: pgsql-hackers
Attachments
- v1-0001-brin-Remove-duplicate-initialization-in-initializ.patch (application/octet-stream) patch v1-0001
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.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
Commits
-
Remove duplicate initialization in initialize_brin_buildstate().
- 59bae234352d 19 (unreleased) landed