pgsql: Don't try to fix eliminated nbtree array scan keys.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't try to fix eliminated nbtree array scan keys.
Date: 2024-04-18 15:49:02
Message-ID: E1rxU0T-002iKQ-UF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't try to fix eliminated nbtree array scan keys.

Preprocessing for nbtree index scans allowed array "input" scan keys
already marked eliminated during array-specific preprocessing to be
"fixed up" during preprocessing proper. This allowed eliminated scan
keys on DESC index columns to spurious have their strategy commuted,
causing assertion failures.

To fix, teach _bt_fix_scankey_strategy to ignore these scan keys. This
brings it in line with its only caller, _bt_preprocess_keys.

Oversight in commit 5bf748b8, which enhanced nbtree ScalarArrayOp
execution.

Reported-By: Donghang Lin <donghanglin(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAA=D8a2sHK6CAzZ=0CeafC-Y-MFXbYxnRSHvZTi=+JHu6kAa8Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f22e17f76cf569a797c45268081feadc8ebd68c7

Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 7 +++++++
1 file changed, 7 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2024-04-18 17:07:34 pgsql: Remove spurious "the".
Previous Message Alvaro Herrera 2024-04-18 15:39:31 Re: pgsql: Fix restore of not-null constraints with inheritance