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

Commit8ea2d2b

Browse files
author
Nikita Glukhov
committed
Optimize JsonToJsonValue() for jsonv containers
1 parent9951a7b commit8ea2d2b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ jsonvContainerOps =
562562
JsonValue*
563563
JsonToJsonValue(Json*json,JsonValue*jv)
564564
{
565+
if (JsonRoot(json)->ops==&jsonvContainerOps)
566+
return (JsonValue*)JsonRoot(json)->data;
567+
565568
if (!jv)
566569
jv=palloc(sizeof(JsonValue));
567570

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,11 +862,11 @@ datum_to_jsonb(Datum val, bool is_null, JsonbInState *result,
862862
{
863863
JsonbIteratorTokentype;
864864

865-
JsonToJsonValue(jsonb,&jb);
866865

867866
if (result->parseState)
868867
{
869-
pushScalarJsonbValue(&result->parseState,&jb,
868+
pushScalarJsonbValue(&result->parseState,
869+
JsonToJsonValue(jsonb,&jb),
870870
false, false);
871871
return;
872872
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp