pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix nbtree unsatisfiable row compare assertion failure.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix nbtree unsatisfiable row compare assertion failure.
@ 2026-10-17 15:04  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Geoghegan @ 2026-10-17 15:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix nbtree unsatisfiable row compare assertion failure.

An assertion within nbtree preprocessing's _bt_mark_scankey_required
function expects the first member key of a row compare to have the same
strategy as its header key, which its caller passes.  But the first row
member key won't necessarily have been commuted in cases where the row
compare is unsatisfiable due to its first member key having a NULL
argument.  This led to spurious assertion failures in the single key
fast path call to _bt_mark_scankey_required.

To fix, always commute the row members, even when the row compare is
unsatisfiable.  That way the header and its members will always agree on
strategy.

Oversight in commit ec986020, which improved nbtree's unsatisfiable
RowCompare detection.

Author: Peter Geoghegan <pg@bowt.ie>
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/45fc51fcbf4534ea2f6f85e36f8155dbd5ba9851

Modified Files
--------------
src/backend/access/nbtree/nbtpreprocesskeys.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix nbtree unsatisfiable row compare assertion failure.
@ 2026-10-17 15:04  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Geoghegan @ 2026-10-17 15:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix nbtree unsatisfiable row compare assertion failure.

An assertion within nbtree preprocessing's _bt_mark_scankey_required
function expects the first member key of a row compare to have the same
strategy as its header key, which its caller passes.  But the first row
member key won't necessarily have been commuted in cases where the row
compare is unsatisfiable due to its first member key having a NULL
argument.  This led to spurious assertion failures in the single key
fast path call to _bt_mark_scankey_required.

To fix, always commute the row members, even when the row compare is
unsatisfiable.  That way the header and its members will always agree on
strategy.

Oversight in commit ec986020, which improved nbtree's unsatisfiable
RowCompare detection.

Author: Peter Geoghegan <pg@bowt.ie>
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/10a0dcfc25fba51b2e0d3bbcb11584ecfb70f848

Modified Files
--------------
src/backend/access/nbtree/nbtpreprocesskeys.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix nbtree unsatisfiable row compare assertion failure.
@ 2026-10-17 15:04  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Geoghegan @ 2026-10-17 15:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix nbtree unsatisfiable row compare assertion failure.

An assertion within nbtree preprocessing's _bt_mark_scankey_required
function expects the first member key of a row compare to have the same
strategy as its header key, which its caller passes.  But the first row
member key won't necessarily have been commuted in cases where the row
compare is unsatisfiable due to its first member key having a NULL
argument.  This led to spurious assertion failures in the single key
fast path call to _bt_mark_scankey_required.

To fix, always commute the row members, even when the row compare is
unsatisfiable.  That way the header and its members will always agree on
strategy.

Oversight in commit ec986020, which improved nbtree's unsatisfiable
RowCompare detection.

Author: Peter Geoghegan <pg@bowt.ie>
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4732a5c53bd858ed057d52286fb6105385baa2a6

Modified Files
--------------
src/backend/access/nbtree/nbtpreprocesskeys.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-10-17 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-17 15:04 pgsql: Fix nbtree unsatisfiable row compare assertion failure. Peter Geoghegan <pg@bowt.ie>
2026-10-17 15:04 pgsql: Fix nbtree unsatisfiable row compare assertion failure. Peter Geoghegan <pg@bowt.ie>
2026-10-17 15:04 pgsql: Fix nbtree unsatisfiable row compare assertion failure. Peter Geoghegan <pg@bowt.ie>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox