Fix Brin Private Spool Initialization (src/backend/access/brin/brin.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix Brin Private Spool Initialization (src/backend/access/brin/brin.c)
Date: 2023-12-26 18:10:30
Message-ID: CAEudQAqD7f2i4iyEaAz-5o-bf6zXVX-AkNUBm-YjUXEemaEh6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The commit b437571 <http://b437571714707bc6466abde1a0af5e69aaade09c> I
think has an oversight.
When allocate memory and initialize private spool in function:
_brin_leader_participate_as_worker

The behavior is the bs_spool (heap and index fields)
are left empty.

The code affected is:
buildstate->bs_spool = (BrinSpool *) palloc0(sizeof(BrinSpool));
- buildstate->bs_spool->heap = buildstate->bs_spool->heap;
- buildstate->bs_spool->index = buildstate->bs_spool->index;
+ buildstate->bs_spool->heap = heap;
+ buildstate->bs_spool->index = index;

Is the fix correct?

best regards,
Ranier Vilela

Attachment Content-Type Size
001-fix-brin-private-spool-initialization.patch application/octet-stream 690 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-12-26 18:15:14 Re: Statistics Import and Export
Previous Message Tomas Vondra 2023-12-26 17:28:43 Re: Add the ability to limit the amount of memory that can be allocated to backends.