diff options
author | Melanie Plageman | 2024-12-19 16:55:03 +0000 |
---|---|---|
committer | Melanie Plageman | 2024-12-19 16:55:03 +0000 |
commit | 754c610e13b820370db4c02010a4c8c5dbd1edbd (patch) | |
tree | 3ab0a79e7ffb19dde4db0f8aaf7df83680dd25c4 /src/backend/nodes | |
parent | 31b0a8f040042c1dfb9ac359fffbb6b8f9375999 (diff) |
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
Diffstat (limited to 'src/backend/nodes')
-rw-r--r-- | src/backend/nodes/tidbitmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c index 687d6f17636..63316d5d655 100644 --- a/src/backend/nodes/tidbitmap.c +++ b/src/backend/nodes/tidbitmap.c @@ -1594,7 +1594,7 @@ tbm_begin_iterate(TIDBitmap *tbm, dsa_area *dsa, dsa_pointer dsp) void tbm_end_iterate(TBMIterator *iterator) { - Assert(iterator); + Assert(iterator && !tbm_exhausted(iterator)); if (iterator->shared) tbm_end_shared_iterate(iterator->i.shared_iterator); |