summaryrefslogtreecommitdiff
path: root/contrib/bloom/blutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bloom/blutils.c')
-rw-r--r--contrib/bloom/blutils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c
index 92ab85811b8..be056c33ba0 100644
--- a/contrib/bloom/blutils.c
+++ b/contrib/bloom/blutils.c
@@ -155,9 +155,9 @@ initBloomState(BloomState *state, Relation index)
index->rd_amcache = (void *) opts;
}
- state->opts = (BloomOptions *) index->rd_amcache;
+ memcpy(&state->opts, index->rd_amcache, sizeof(state->opts));
state->sizeOfBloomTuple = BLOOMTUPLEHDRSZ +
- sizeof(SignType) * state->opts->bloomLength;
+ sizeof(SignType) * state->opts.bloomLength;
}
/*
@@ -228,10 +228,10 @@ signValue(BloomState *state, SignType *sign, Datum value, int attno)
hashVal = DatumGetInt32(FunctionCall1(&state->hashFn[attno], value));
mySrand(hashVal ^ myRand());
- for (j = 0; j < state->opts->bitSize[attno]; j++)
+ for (j = 0; j < state->opts.bitSize[attno]; j++)
{
/* prevent mutiple evaluation */
- nBit = myRand() % (state->opts->bloomLength * BITSIGNTYPE);
+ nBit = myRand() % (state->opts.bloomLength * BITSIGNTYPE);
SETBIT(sign, nBit);
}
}