Avoid overwiriting cache entry (src/backend/utils/cache/relcache.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Avoid overwiriting cache entry (src/backend/utils/cache/relcache.c)
Date: 2025-08-26 14:17:33
Message-ID: CAEudQAr=i3_Z4GvmediX900+sSySTeMkvuytYShhQqEwoGyvhA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

In function *CheckNNConstraintFetch* the array index is
incremented only when "null combin" is not found.

IMO the last cache entry can be overwriting if the next tuple is null,
because, the fill array fields is not syncronized with array index
increment.

Fix by moving the array fill.

patch attached.

best regards,
Ranier Vilela

Attachment Content-Type Size
v1-001-avoid-overwiriting-cache-entry-relcache.patch application/octet-stream 1.2 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2025-08-26 14:25:21 Marking shared buffer lookup table as HASH_FIXED_SIZE
Previous Message Damien Clochard 2025-08-26 14:17:03 Re: [PATCH] Generate random dates/times in a specified range