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

Commitaa41d7d

Browse files
Nikita MalakhovNikita Glukhov
Nikita Malakhov
authored and
Nikita Glukhov
committed
Minor changes to build jsonb_toaster and make it work
1 parent4263788 commitaa41d7d

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

‎contrib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SUBDIRS = \
2424
earthdistance\
2525
file_fdw\
2626
fuzzystrmatch\
27+
jsonb_toaster\
2728
hstore\
2829
intagg\
2930
intarray\

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ jsonb_recv(PG_FUNCTION_ARGS)
108108
Datum
109109
jsonb_out(PG_FUNCTION_ARGS)
110110
{
111+
Jsonb*jb;
112+
char*out;
113+
111114
jsonbInitIterators();
112115

113-
Jsonb*jb=PG_GETARG_JSONB_P(0);
114-
char*out;
116+
jb=PG_GETARG_JSONB_P(0);
115117

116118
out=JsonToCString(JsonbRoot(jb),NULL);
117119

@@ -129,13 +131,16 @@ jsonb_out(PG_FUNCTION_ARGS)
129131
Datum
130132
jsonb_send(PG_FUNCTION_ARGS)
131133
{
132-
jsonbInitIterators();
133-
134-
Jsonb*jb=PG_GETARG_JSONB_P(0);
134+
Jsonb*jb;
135135
StringInfoDatabuf;
136-
StringInfojtext=makeStringInfo();
136+
StringInfojtext;
137137
intversion=1;
138138

139+
jsonbInitIterators();
140+
141+
jb=PG_GETARG_JSONB_P(0);
142+
jtext=makeStringInfo();
143+
139144
(void)JsonToCString(JsonbRoot(jb),jtext);
140145

141146
jsonbFreeIterators();

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2368,9 +2368,11 @@ convertJsonbBinary(StringInfo buffer, JEntry *pheader, const JsonbValue *val,
23682368
appendToBuffer(buffer, (void*)jbc,jc->len);
23692369
*pheader=JENTRY_ISCONTAINER | (buffer->len-base_offset);
23702370
}
2371+
#if0/* XXX jsonv */
23712372
elseif (jc->ops==&jsonvContainerOps&& !JsonContainerIsScalar(jc))
23722373
convertJsonbValue(buffer,pheader,
23732374
(constJsonValue*)JsonContainerDataPtr(jc),level);
2375+
#endif
23742376
else
23752377
convertJsonbValue(buffer,pheader,JsonValueUnpackBinary(val),level);
23762378
}
@@ -2649,7 +2651,7 @@ jsonbzInitContainer(JsonContainerData *jc, CompressedJsonb *cjb,
26492651
JsonbContainerHdrheader=pheader ?*pheader :jbc->header;
26502652

26512653
*(CompressedJsonb*)&jc->_data=*cjb;
2652-
((CompressedJsonb*)&jc->_data)->header=header;
2654+
/*((CompressedJsonb *) &jc->_data)->header = header; */
26532655

26542656
jc->ops=&jsonbzContainerOps;
26552657
jc->len=len;

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,13 @@ numeric_in(PG_FUNCTION_ARGS)
734734
Datum
735735
numeric_out(PG_FUNCTION_ARGS)
736736
{
737-
Assert(!VARATT_IS_COMPRESSED(PG_GETARG_DATUM(0)));
738-
Numericnum=PG_GETARG_NUMERIC(0);
737+
Numericnum;
739738
NumericVarx;
740739
char*str;
741740

741+
Assert(!VARATT_IS_COMPRESSED(PG_GETARG_DATUM(0)));
742+
num=PG_GETARG_NUMERIC(0);
743+
742744
/*
743745
* Handle NaN and infinities
744746
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp