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

Commit3ea91d7

Browse files
committed
Merge branch 'master' into vodka
2 parentsd87a1e1 +1cfc4b1 commit3ea91d7

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
@@ -244,6 +244,18 @@ make_gin_key(JsonbValue *v, uint32 hash)
244244
key->type=v->type | (v->val.boolean ?GINKeyTrue :0);
245245
SET_VARSIZE(key,GINKEYLEN);
246246
}
247+
elseif (v->type==jbvArray)
248+
{
249+
key= (GINKey*)palloc(GINKEYLEN);
250+
key->type=v->type;
251+
SET_VARSIZE(key,GINKEYLEN);
252+
}
253+
elseif (v->type==jbvObject)
254+
{
255+
key= (GINKey*)palloc(GINKEYLEN);
256+
key->type=v->type;
257+
SET_VARSIZE(key,GINKEYLEN);
258+
}
247259
elseif (v->type==jbvNumeric)
248260
{
249261
key= (GINKey*)palloc(GINKeyLenNumeric(VARSIZE_ANY(v->val.numeric)));
@@ -386,6 +398,10 @@ compare_gin_key_value(GINKey *arg1, GINKey *arg2)
386398
{
387399
casejbvNull:
388400
return0;
401+
casejbvArray:
402+
return0;
403+
casejbvObject:
404+
return0;
389405
casejbvBool:
390406
if (GINKeyIsTrue(arg1)==GINKeyIsTrue(arg2))
391407
return0;
@@ -978,16 +994,20 @@ gin_extract_jsonb_hash_value_internal(Jsonb *jb, int32 *nentries)
978994
switch (r)
979995
{
980996
caseWJB_BEGIN_ARRAY:
997+
entries[i++]=PointerGetDatum(make_gin_key(&v,stack->hash));
998+
tmp=stack;
999+
stack= (PathHashStack*)palloc(sizeof(PathHashStack));
1000+
stack->parent=tmp;
1001+
stack->hash=stack->parent->hash;
1002+
stack->hash= (stack->hash <<1) | (stack->hash >>31);
1003+
stack->hash ^=JB_FARRAY;
1004+
break;
9811005
caseWJB_BEGIN_OBJECT:
1006+
entries[i++]=PointerGetDatum(make_gin_key(&v,stack->hash));
9821007
tmp=stack;
9831008
stack= (PathHashStack*)palloc(sizeof(PathHashStack));
9841009
stack->parent=tmp;
9851010
stack->hash=stack->parent->hash;
986-
if (r==WJB_BEGIN_ARRAY)
987-
{
988-
stack->hash= (stack->hash <<1) | (stack->hash >>31);
989-
stack->hash ^=JB_FARRAY;
990-
}
9911011
break;
9921012
caseWJB_KEY:
9931013
/* Initialize hash from parent */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp