Remove redundant _bt_killitems() buffer check.
authorPeter Geoghegan <pg@bowt.ie>
Thu, 30 Apr 2020 01:17:49 +0000 (18:17 -0700)
committerPeter Geoghegan <pg@bowt.ie>
Thu, 30 Apr 2020 01:17:49 +0000 (18:17 -0700)
_bt_getbuf() cannot return an invalid buffer.

Oversight in commit 2ed5b87f96d.

src/backend/access/nbtree/nbtutils.c

index ce48a51640a6bca8ef1274d2779f9b37be20e75b..84b391ce038a35827dd1cb1b65b43f595d03ec2f 100644 (file)
@@ -1756,10 +1756,6 @@ _bt_killitems(IndexScanDesc scan)
        /* Attempt to re-read the buffer, getting pin and lock. */
        buf = _bt_getbuf(scan->indexRelation, so->currPos.currPage, BT_READ);
 
-       /* It might not exist anymore; in which case we can't hint it. */
-       if (!BufferIsValid(buf))
-           return;
-
        page = BufferGetPage(buf);
        if (BufferGetLSNAtomic(buf) == so->currPos.lsn)
            so->currPos.buf = buf;