Fix bitmap table scan crash on iterator release
authorMelanie Plageman <melanieplageman@gmail.com>
Thu, 19 Dec 2024 16:55:03 +0000 (11:55 -0500)
committerMelanie Plageman <melanieplageman@gmail.com>
Thu, 19 Dec 2024 16:55:03 +0000 (11:55 -0500)
commit754c610e13b820370db4c02010a4c8c5dbd1edbd
tree3ab0a79e7ffb19dde4db0f8aaf7df83680dd25c4
parent31b0a8f040042c1dfb9ac359fffbb6b8f9375999
Fix bitmap table scan crash on iterator release

1a0da347a7ac98db replaced Bitmap Table Scan's individual private and
shared iterators with a unified iterator. It neglected, however, to
check if the iterator had already been cleaned up before doing so on
rescan. Add this check both on rescan and end scan to be safe.

Reported-by: Richard Guo
Author: Richard Guo
Discussion: https://postgr.es/m/CAMbWs48nrhcLY1kcd-u9oD%2B6yiS631F_8Fx8ZGsO-BYDwH%2Bbyw%40mail.gmail.com
src/backend/executor/nodeBitmapHeapscan.c
src/backend/nodes/tidbitmap.c
src/test/regress/expected/join.out
src/test/regress/sql/join.sql