]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove redundant nbtree preprocessing assertions.
authorPeter Geoghegan <pg@bowt.ie>
Mon, 8 Apr 2024 02:13:28 +0000 (22:13 -0400)
committerPeter Geoghegan <pg@bowt.ie>
Mon, 8 Apr 2024 02:13:28 +0000 (22:13 -0400)
One of the assertions was the subject of a false positive complaint from
Coverity, but none of the assertions added much, so get rid of them.

Reported-By: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/3000247.1712537309@sss.pgh.pa.us

src/backend/access/nbtree/nbtutils.c

index 9b9efe062fce68e2e721ec7258af7786e4d22a47..2eff34c4aa6a04189e93a2a696855e3d96cbf799 100644 (file)
@@ -2937,7 +2937,6 @@ _bt_preprocess_keys(IndexScanDesc scan)
                                        if (j != (BTEqualStrategyNumber - 1) ||
                                                !(xform[j].skey->sk_flags & SK_SEARCHARRAY))
                                        {
-                                               Assert(!array || array->scan_key == i);
                                                xform[j].skey = cur;
                                                xform[j].ikey = i;
                                                xform[j].arrayidx = arrayidx;
@@ -2951,9 +2950,6 @@ _bt_preprocess_keys(IndexScanDesc scan)
                                                 * scan key.  _bt_compare_scankey_args expects us to
                                                 * always keep arrays (and discard non-arrays).
                                                 */
-                                               Assert(j == (BTEqualStrategyNumber - 1));
-                                               Assert(xform[j].skey->sk_flags & SK_SEARCHARRAY);
-                                               Assert(xform[j].ikey == array->scan_key);
                                                Assert(!(cur->sk_flags & SK_SEARCHARRAY));
                                        }
                                }