1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Fix contrib/bloom to not fail under CLOBBER_CACHE_ALWAYS.

The code was supposing that rd_amcache wouldn't disappear from under it
during a scan; which is wrong.  Copy the data out of the relcache rather
than trying to reference it there.
This commit is contained in:
Tom Lane
2016-04-03 15:16:07 -04:00
parent a9284849b4
commit 8f75fd1f40
3 changed files with 8 additions and 9 deletions

View File

@ -99,7 +99,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
/* New search: have to calculate search signature */
ScanKey skey = scan->keyData;
so->sign = palloc0(sizeof(SignType) * so->state.opts->bloomLength);
so->sign = palloc0(sizeof(SignType) * so->state.opts.bloomLength);
for (i = 0; i < scan->numberOfKeys; i++)
{
@ -151,7 +151,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
bool res = true;
/* Check index signature with scan signature */
for (i = 0; i < so->state.opts->bloomLength; i++)
for (i = 0; i < so->state.opts.bloomLength; i++)
{
if ((itup->sign[i] & so->sign[i]) != so->sign[i])
{