Hi.
I have reviewed this patch too. Attached new version with v8-v9 delta-patch.
Here is my changes:
* HV_ToJsonbValue(): - addded missing hv_iterinit() - used hv_iternextsv() instead of hv_iternext(), HeSVKEY_force(), HeVAL()
* SV_ToJsonbValue(): - added recursive dereferencing for all SV types - removed unnecessary JsonbValue heap-allocations
* Jsonb_ToSV(): - added iteration to the end of iterator needed for correct freeing of JsonbIterators
* passed JsonbParseState ** to XX_ToJsonbValue() functions.* fixed warnings (see below)
* fixed comments (see below)
Also I am not sure if we need to use newRV() for returning SVs in
Jsonb_ToSV() and JsonbValue_ToSV().
On 12.03.2018 18:06, Pavel Stehule wrote:
pg_unreachable() is replaced with elog(ERROR) for reporting impossible
JsonbValue types and JsonbIteratorTokens.
I have not removed duplicate test yet, because I am not sure that this test does not make sense at all.
Renamed to Jsonb_ToSV() and JsonbValue_ToSV().
Fixed.