Adjust overstrong nbtree skip array assertion.
authorPeter Geoghegan <pg@bowt.ie>
Thu, 1 May 2025 03:15:51 +0000 (23:15 -0400)
committerPeter Geoghegan <pg@bowt.ie>
Thu, 1 May 2025 03:15:51 +0000 (23:15 -0400)
Make an nbtree array preprocessing assertion account for scans that add
fewer skip arrays than initially expected due to preprocessing finding
an unsatisfiable array qual.

Oversight in commit 92fe23d9.

Author: Peter Geoghegan <pg@bowt.ie>
Reported-By: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://postgr.es/m/CAHgHdKtQMhHy5qcB3KqCcGiW-Rp8P7KzUFRa9ZMKUiv6zen7LQ@mail.gmail.com

src/backend/access/nbtree/nbtpreprocesskeys.c

index 1cc99e6cdf2b7d27a7e7440689b8bec7c16cbdb5..a136e4bbfdfb58b0607adcf67520c89645e0cae7 100644 (file)
@@ -1856,7 +1856,7 @@ _bt_preprocess_array_keys(IndexScanDesc scan, int *new_numberOfKeys)
        numArrayKeyData++;      /* keep this scan key/array */
    }
 
-   Assert(numSkipArrayKeys == 0);
+   Assert(numSkipArrayKeys == 0 || !so->qual_ok);
 
    /* Set final number of equality-type array keys */
    so->numArrayKeys = numArrayKeys;