@@ -2855,10 +2855,23 @@ JsonbzArrayIteratorInit(JsonbzArrayIterator *it, CompressedJsonb *cjb)
2855
2855
#endif
2856
2856
const JsonbContainerHeader * jbc = (const JsonbContainerHeader * )((char * ) jb + cjb -> offset );
2857
2857
2858
+ #ifndef JSONB_DETOAST_ITERATOR
2859
+ CompressedDatumDecompress (cjb -> datum , cjb -> offset + ((char * ) & jbc -> children - (char * ) jbc ));
2860
+ #else
2861
+ PG_DETOAST_ITERATE (cjb -> iter , (const char * ) & jbc -> children );
2862
+ #endif
2863
+
2864
+ it -> count = (jbc -> header & JBC_CMASK );
2865
+
2866
+ #ifndef JSONB_DETOAST_ITERATOR
2867
+ CompressedDatumDecompress (cjb -> datum , cjb -> offset + ((char * ) & jbc -> children [it -> count ] - (char * ) jbc ));
2868
+ #else
2869
+ PG_DETOAST_ITERATE (cjb -> iter , (const char * ) & jbc -> children [it -> count ]);
2870
+ #endif
2871
+
2858
2872
it -> cjb = cjb ;
2859
2873
it -> container = jbc ;
2860
2874
it -> index = 0 ;
2861
- it -> count = (jbc -> header & JBC_CMASK );
2862
2875
it -> offset = 0 ;
2863
2876
it -> base_addr = (char * ) & jbc -> children [it -> count ];
2864
2877
}
@@ -2972,7 +2985,7 @@ jsonbzInitFromDetoastIterator(JsonContainerData *jc, DetoastIterator iter)
2972
2985
if (!jsonb_partial_decompression )
2973
2986
PG_DETOAST_ITERATE (iter , iter -> buf -> capacity );
2974
2987
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 ));
2976
2989
2977
2990
jsonbzInitContainer (jc , cjb , VARSIZE_ANY_EXHDR (iter -> buf -> buf )); // cd->total_len - VARHDRSZ
2978
2991
#endif
0 commit comments