Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions jsonb_gin_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ get_query_path_bloom(PathItem *pathItem, bool *lossy)

if (pathItem->type == iKey)
{
hash = hash_any((unsigned char *)pathItem->s, pathItem->len);
hash = DatumGetUInt32(hash_any((unsigned char *)pathItem->s, pathItem->len));
val = get_bloom_value(hash);
res |= val;
}
Expand Down Expand Up @@ -296,8 +296,8 @@ make_gin_key(JsonbValue *v, uint32 hash)
{
key = (GINKey *) palloc0(GINKeyLenString);
key->type = v->type;
GINKeyDataString(key) = hash_any((unsigned char *)v->val.string.val,
v->val.string.len);
GINKeyDataString(key) = DatumGetUInt32(hash_any((unsigned char *)v->val.string.val,
v->val.string.len));
SET_VARSIZE(key, GINKeyLenString);
break;
}
Expand Down Expand Up @@ -341,7 +341,7 @@ make_gin_query_value_key(JsQueryItem *value, uint32 hash)
key = (GINKey *)palloc(GINKeyLenString);
key->type = jbvString;
s = jsqGetString(value, &len);
GINKeyDataString(key) = hash_any((unsigned char *)s, len);
GINKeyDataString(key) = DatumGetUInt32(hash_any((unsigned char *)s, len));
SET_VARSIZE(key, GINKeyLenString);
break;
case jqiBool:
Expand Down Expand Up @@ -952,7 +952,7 @@ get_query_path_hash(PathItem *pathItem, uint32 *hash)
if (pathItem->type == iKey)
{
*hash = (*hash << 1) | (*hash >> 31);
*hash ^= hash_any((unsigned char *)pathItem->s, pathItem->len);
*hash ^= DatumGetUInt32(hash_any((unsigned char *)pathItem->s, pathItem->len));
}
else if (pathItem->type == iAnyArray || pathItem->type == iIndexArray)
{
Expand Down
5 changes: 4 additions & 1 deletion jsquery_gram.y
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ makeItemNumeric(string *s)
JsQueryParseItem *v;

v = makeItemType(jqiNumeric);
v->numeric = DatumGetNumeric(DirectFunctionCall3(numeric_in, CStringGetDatum(s->val), 0, -1));
v->numeric = DatumGetNumeric(DirectFunctionCall3(numeric_in,
CStringGetDatum(s->val),
ObjectIdGetDatum(InvalidOid),
Int32GetDatum(-1)));

return v;
}
Expand Down