Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1cfc4b1

Browse files
committed
Fix = * for jsonb_hash_value_ops.
1 parentaa36e6f commit1cfc4b1

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

‎jsonb_gin_ops.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,18 @@ make_gin_key(JsonbValue *v, uint32 hash)
245245
key->type=v->type | (v->val.boolean ?GINKeyTrue :0);
246246
SET_VARSIZE(key,GINKEYLEN);
247247
}
248+
elseif (v->type==jbvArray)
249+
{
250+
key= (GINKey*)palloc(GINKEYLEN);
251+
key->type=v->type;
252+
SET_VARSIZE(key,GINKEYLEN);
253+
}
254+
elseif (v->type==jbvObject)
255+
{
256+
key= (GINKey*)palloc(GINKEYLEN);
257+
key->type=v->type;
258+
SET_VARSIZE(key,GINKEYLEN);
259+
}
248260
elseif (v->type==jbvNumeric)
249261
{
250262
key= (GINKey*)palloc(GINKeyLenNumeric(VARSIZE_ANY(v->val.numeric)));
@@ -387,6 +399,10 @@ compare_gin_key_value(GINKey *arg1, GINKey *arg2)
387399
{
388400
casejbvNull:
389401
return0;
402+
casejbvArray:
403+
return0;
404+
casejbvObject:
405+
return0;
390406
casejbvBool:
391407
if (GINKeyIsTrue(arg1)==GINKeyIsTrue(arg2))
392408
return0;
@@ -979,16 +995,20 @@ gin_extract_jsonb_hash_value_internal(Jsonb *jb, int32 *nentries)
979995
switch (r)
980996
{
981997
caseWJB_BEGIN_ARRAY:
998+
entries[i++]=PointerGetDatum(make_gin_key(&v,stack->hash));
999+
tmp=stack;
1000+
stack= (PathHashStack*)palloc(sizeof(PathHashStack));
1001+
stack->parent=tmp;
1002+
stack->hash=stack->parent->hash;
1003+
stack->hash= (stack->hash <<1) | (stack->hash >>31);
1004+
stack->hash ^=JB_FARRAY;
1005+
break;
9821006
caseWJB_BEGIN_OBJECT:
1007+
entries[i++]=PointerGetDatum(make_gin_key(&v,stack->hash));
9831008
tmp=stack;
9841009
stack= (PathHashStack*)palloc(sizeof(PathHashStack));
9851010
stack->parent=tmp;
9861011
stack->hash=stack->parent->hash;
987-
if (r==WJB_BEGIN_ARRAY)
988-
{
989-
stack->hash= (stack->hash <<1) | (stack->hash >>31);
990-
stack->hash ^=JB_FARRAY;
991-
}
9921012
break;
9931013
caseWJB_KEY:
9941014
/* Initialize hash from parent */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp