pgsql: Fix bitmap table scan crash on iterator release

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix bitmap table scan crash on iterator release
Date: 2024-12-19 16:57:38
Message-ID: E1tOJqE-000NlC-EP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/754c610e13b820370db4c02010a4c8c5dbd1edbd

Modified Files
--------------
src/backend/executor/nodeBitmapHeapscan.c | 12 +++++++----
src/backend/nodes/tidbitmap.c | 2 +-
src/test/regress/expected/join.out | 35 +++++++++++++++++++++++++++++++
src/test/regress/sql/join.sql | 17 +++++++++++++++
4 files changed, 61 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2024-12-19 22:03:01 pgsql: Convert SetOp to read its inputs as outerPlan and innerPlan.
Previous Message Peter Geoghegan 2024-12-19 16:09:06 pgsql: Avoid nbtree index scan SAOP scanBehind confusion.