Skip to content

Commit 14d4821

Browse files
author
Nikita Glukhov
committed
Pass toaster id to encode method
1 parent 8e9a0cf commit 14d4821

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/backend/utils/adt/json_generic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ JsonbValueToOrigJsonbDatum(JsonValue *val, Json *orig_json)
166166
if (val->type != jbvBinary &&
167167
JsonRoot(orig_json)->ops->encode)
168168
{
169-
void *res = JsonRoot(orig_json)->ops->encode(val, &jsonbContainerOps);
169+
void *res =
170+
JsonRoot(orig_json)->ops->encode(val, &jsonbContainerOps,
171+
JsonRoot(orig_json)->toasterid);
170172

171173
if (res)
172174
return PointerGetDatum(res);

src/backend/utils/adt/jsonb_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ JsonContainerFlatten(JsonContainer *jc, JsonValueEncoder encoder,
126126
void *res;
127127

128128
JsonValueInitBinary(&bin, jc);
129-
res = jc->ops->encode(&bin, ops);
129+
res = jc->ops->encode(&bin, ops, jc->toasterid);
130130

131131
if (res)
132132
return res;

src/include/utils/json_generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct JsonContainerOps
6464
int estimated_len);
6565
JsonContainer *(*copy)(JsonContainer *jc);
6666
void (*free)(JsonContainer *jc);
67-
void *(*encode)(JsonValue *jc, JsonContainerOps *ops);
67+
void *(*encode)(JsonValue *jc, JsonContainerOps *ops, Oid toasterid);
6868
};
6969

7070
typedef struct CompressedObject

0 commit comments

Comments
 (0)