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

Commit9429f3f

Browse files
author
Nikita Glukhov
committed
Return back JsonInit()
This reverts commit 7fbff1afd2632039d28122cd852001957884134e.
1 parente133dea commit9429f3f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ JsonToJsonValue(Json *json, JsonValue *jv)
6969
returnJsonValueInitBinary(jv,&json->root);
7070
}
7171

72+
staticvoid
73+
JsonInit(Json*json)
74+
{
75+
constvoid*data=DatumGetPointer(json->obj.value);
76+
structvarlena*detoasted_data;
77+
78+
Assert(JsonContainerDataPtr(&json->root)||data);
79+
80+
if (JsonContainerDataPtr(&json->root)|| !data)/* FIXME */
81+
return;
82+
83+
detoasted_data=PG_DETOAST_DATUM(json->obj.value);
84+
json->obj.value=PointerGetDatum(detoasted_data);
85+
json->obj.freeValue |=data!=detoasted_data;
86+
87+
json->root.ops->init(&json->root,json->obj.value);
88+
}
89+
7290
staticJson*
7391
JsonExpand(Json*tmp,Datumvalue,boolfreeValue,JsonContainerOps*ops)
7492
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp