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

Commitbb69550

Browse files
author
Nikita Glukhov
committed
Fix temporary Json allocation
1 parentaa41d7d commitbb69550

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎contrib/jsonb_toaster/jsonb_toaster.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,8 +2532,8 @@ jsonb_toaster_copy(Relation rel, JsonContainer *jc, char cmethod)
25322532
if (JsonContainerContainsToasted(jc))
25332533
{
25342534
//Json *js = DatumGetJson(PointerGetDatum(jb), &jsonxContainerOps, NULL);
2535-
Jsonjsbuf;
2536-
Json*js=JsonExpand(&jsbuf,PointerGetDatum(jb), false,&jsonxContainerOps);
2535+
char*jsbuf=alloca(JsonAllocSize(jsonxContainerOps.data_size));/* XXX */
2536+
Json*js=JsonExpand((Json*)jsbuf,PointerGetDatum(jb), false,&jsonxContainerOps);
25372537

25382538
jsonxInit(JsonRoot(js),PointerGetDatum(jb));
25392539

@@ -2764,8 +2764,8 @@ jsonb_toaster_cmp(Relation rel, JsonContainer *new_jc, JsonContainer *old_jc, ch
27642764
#endif
27652765
{
27662766
//Json *js = DatumGetJson(PointerGetDatum(jb), &jsonxContainerOps, NULL);
2767-
Jsonjsbuf;
2768-
Json*js=JsonExpand(&jsbuf,PointerGetDatum(jb), false,&jsonxContainerOps);
2767+
char*jsbuf=alloca(JsonAllocSize(jsonxContainerOps.data_size));/* XXX */
2768+
Json*js=JsonExpand((Json*)jsbuf,PointerGetDatum(jb), false,&jsonxContainerOps);
27692769

27702770
jsonxInit(JsonRoot(js),PointerGetDatum(jb));
27712771

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp