diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2023-11-09 01:33:14 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2023-11-09 01:33:14 +0200 |
commit | 8f4a1ab471e6a258881e3d7f5883705714cde7e1 (patch) | |
tree | 1199c23ac5424a12afbc16c8f34d79bdc81379c9 /src/backend/utils/adt/arrayutils.c | |
parent | 322f55bdbd018bf18a0c5605c7bc592c625dc263 (diff) | |
download | postgresql-8f4a1ab471e6a258881e3d7f5883705714cde7e1.tar.gz postgresql-8f4a1ab471e6a258881e3d7f5883705714cde7e1.zip |
Fix bug in the new ResourceOwner implementation.
When the hash table is in use, ResoureOwnerSort() moves any elements
from the small fixed-size array to the hash table, and sorts it. When
the hash table is not in use, it sorts the elements in the small
fixed-size array directly. However, ResourceOwnerSort() and
ResourceOwnerReleaseAll() had different idea on when the hash table is
in use: ResourceOwnerSort() checked owner->nhash != 0, and
ResourceOwnerReleaseAll() checked owner->hash != NULL. If the hash
table was allocated but was currently empty, you hit an assertion
failure.
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://www.postgresql.org/message-id/be58d565-9e95-d417-4e47-f6bd408dea4b@gmail.com
Diffstat (limited to 'src/backend/utils/adt/arrayutils.c')
0 files changed, 0 insertions, 0 deletions