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:
@ -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])
|
||||
{
|
||||
|
Reference in New Issue
Block a user