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

Commit38259fd

Browse files
author
Nikita Glukhov
committed
Fix initialization of JsonbzArrayIterator
1 parentb9acb6b commit38259fd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

‎src/backend/utils/adt/jsonb_util.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2855,10 +2855,23 @@ JsonbzArrayIteratorInit(JsonbzArrayIterator *it, CompressedJsonb *cjb)
28552855
#endif
28562856
constJsonbContainerHeader*jbc= (constJsonbContainerHeader*)((char*)jb+cjb->offset);
28572857

2858+
#ifndefJSONB_DETOAST_ITERATOR
2859+
CompressedDatumDecompress(cjb->datum,cjb->offset+ ((char*)&jbc->children- (char*)jbc));
2860+
#else
2861+
PG_DETOAST_ITERATE(cjb->iter, (constchar*)&jbc->children);
2862+
#endif
2863+
2864+
it->count= (jbc->header&JBC_CMASK);
2865+
2866+
#ifndefJSONB_DETOAST_ITERATOR
2867+
CompressedDatumDecompress(cjb->datum,cjb->offset+ ((char*)&jbc->children[it->count]- (char*)jbc));
2868+
#else
2869+
PG_DETOAST_ITERATE(cjb->iter, (constchar*)&jbc->children[it->count]);
2870+
#endif
2871+
28582872
it->cjb=cjb;
28592873
it->container=jbc;
28602874
it->index=0;
2861-
it->count= (jbc->header&JBC_CMASK);
28622875
it->offset=0;
28632876
it->base_addr= (char*)&jbc->children[it->count];
28642877
}
@@ -2972,7 +2985,7 @@ jsonbzInitFromDetoastIterator(JsonContainerData *jc, DetoastIterator iter)
29722985
if (!jsonb_partial_decompression)
29732986
PG_DETOAST_ITERATE(iter,iter->buf->capacity);
29742987
else
2975-
PG_DETOAST_ITERATE(iter,Min(iter->buf->buf+ offsetof(Jsonb,root.children),iter->buf->capacity));
2988+
PG_DETOAST_ITERATE(iter,Min(iter->buf->buf+ offsetof(JsonbDatum,root.children),iter->buf->capacity));
29762989

29772990
jsonbzInitContainer(jc,cjb,VARSIZE_ANY_EXHDR(iter->buf->buf));// cd->total_len - VARHDRSZ
29782991
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp