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

Commitb42c1ec

Browse files
author
Nikita Glukhov
committed
TMP: Fix warnings
1 parent9083688 commitb42c1ec

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

‎contrib/jsonb_toaster/jsonb_toast_internals.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,7 @@ jsonx_toast_delete_datum(Datum value, bool is_speculative)
900900
table_close(toastrel,NoLock);
901901
}
902902

903+
#if0
903904
staticvoid
904905
jsonx_process_toast_chunk(Relationtoastrel,Oidvalueid,structvarlena*result,
905906
intchunk_data_size,intattrsize,intchunksize,
@@ -953,6 +954,7 @@ jsonx_process_toast_chunk(Relation toastrel, Oid valueid, struct varlena *result
953954
chunkdata+chcpystrt,
954955
(chcpyend-chcpystrt)+1);
955956
}
957+
#endif
956958

957959
staticvoid
958960
jsonx_create_fetch_datum_iterator_scan(JsonxFetchDatumIteratoriter,int32first_chunkno)

‎contrib/jsonb_toaster/jsonb_toaster.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,6 +2914,9 @@ jsonb_toaster_save_object(Relation rel, Oid toasterid, JsonContainer *root,
29142914
JsonContainer*jc;
29152915
JsonbContainerHeader*jbc;
29162916

2917+
Datumvalue_to_toast;
2918+
boolcompress_chunks;
2919+
29172920
for (i=0;i<nkeys;i++)
29182921
{
29192922
if (pairs[i].value.type==jbvBinary&&
@@ -3045,9 +3048,6 @@ jsonb_toaster_save_object(Relation rel, Oid toasterid, JsonContainer *root,
30453048
if (!jsonb_toast_fields)
30463049
gotoexit;
30473050

3048-
Datumvalue_to_toast;
3049-
boolcompress_chunks;
3050-
30513051
if (jsonb_compress_chunks&&orig_val)
30523052
{
30533053
compress_chunks= true;
@@ -3108,8 +3108,8 @@ jsonb_toaster_save_object(Relation rel, Oid toasterid, JsonContainer *root,
31083108

31093109
//Assert(VARSIZE_ANY(toasted_val) == TOAST_POINTER_SIZE);
31103110

3111-
fields[max_key_idx].orig_value=(Datum)0;
3112-
fields[max_key_idx].value=(Datum)0;
3111+
fields[max_key_idx].orig_value=NULL;
3112+
fields[max_key_idx].value=NULL;
31133113
fields[max_key_idx].size= offsetof(JsonbToastedContainerPointer,data)+VARSIZE_ANY(toasted_val);//TOAST_POINTER_SIZE;
31143114
fields[max_key_idx].status='t';
31153115
pairs[max_key_idx].value.val.binary.data=jsonxzInitContainerFromDatum(jc,toasted_val);
@@ -3652,7 +3652,7 @@ jsonb_toaster_default_toast(Relation rel, Oid toasterid, char cmethod,
36523652
NULL,options,NULL,NULL, false);
36533653
}
36543654

3655-
staticstructvarlena*
3655+
staticDatum
36563656
jsonb_toaster_toast(Relationrel,Oidtoasterid,
36573657
Datumnew_val,Datumold_val,
36583658
intmax_inline_size,intoptions)
@@ -3678,10 +3678,10 @@ jsonb_toaster_toast(Relation rel, Oid toasterid,
36783678

36793679
jsonbFreeIterators();
36803680

3681-
return(structvarlena*)DatumGetPointer(res);
3681+
returnres;
36823682
}
36833683

3684-
staticstructvarlena*
3684+
staticDatum
36853685
jsonb_toaster_update_toast(Relationrel,Oidtoasterid,
36863686
Datumnew_val,Datumold_val,
36873687
intoptions)
@@ -3699,10 +3699,10 @@ jsonb_toaster_update_toast(Relation rel, Oid toasterid,
36993699

37003700
jsonbFreeIterators();
37013701

3702-
return(structvarlena*)DatumGetPointer(res);
3702+
returnres;
37033703
}
37043704

3705-
staticstructvarlena*
3705+
staticDatum
37063706
jsonb_toaster_copy_toast(Relationrel,Oidtoasterid,
37073707
Datumnew_val,intoptions)
37083708
{
@@ -3717,7 +3717,7 @@ jsonb_toaster_copy_toast(Relation rel, Oid toasterid,
37173717

37183718
jsonbFreeIterators();
37193719

3720-
return(structvarlena*)DatumGetPointer(res);
3720+
returnres;
37213721
}
37223722

37233723
staticvoid
@@ -3733,11 +3733,11 @@ jsonb_toaster_delete_toast(Datum val, bool is_speculative)
37333733
jsonbFreeIterators();
37343734
}
37353735

3736-
staticstructvarlena*
3736+
staticDatum
37373737
jsonb_toaster_detoast(Datumtoastptr,intsliceoffset,intslicelength)
37383738
{
37393739
structvarlena*result;
3740-
Jsonjsbuf;
3740+
//Jsonjsbuf;
37413741
Json*js;
37423742
JsonValuebin;
37433743
void*detoasted;
@@ -3758,7 +3758,7 @@ jsonb_toaster_detoast(Datum toastptr, int sliceoffset, int slicelength)
37583758
jsonbFreeIterators();
37593759

37603760
if (sliceoffset==0&& (slicelength<0||slicelength >=len))
3761-
returndetoasted;
3761+
returnPointerGetDatum(detoasted);
37623762

37633763
if (sliceoffset<0)
37643764
sliceoffset=0;
@@ -3774,7 +3774,7 @@ jsonb_toaster_detoast(Datum toastptr, int sliceoffset, int slicelength)
37743774

37753775
pfree(detoasted);
37763776

3777-
returnresult;
3777+
returnPointerGetDatum(result);
37783778
}
37793779

37803780
staticvoid*
@@ -3789,10 +3789,11 @@ jsonb_toaster_vtable(Datum toast_ptr)
37893789
}
37903790

37913791
staticvoid
3792-
jsonb_toaster_init(Relationrel,Datumreloptions,LOCKMODElockmode,
3792+
jsonb_toaster_init(Relationrel,Oidtoastoid,Oidtoastindexoid,
3793+
Datumreloptions,LOCKMODElockmode,
37933794
boolcheck,OidOIDOldToast)
37943795
{
3795-
(void)create_toast_table(rel,InvalidOid,InvalidOid,reloptions,
3796+
(void)create_toast_table(rel,toastoid,toastindexoid,reloptions,
37963797
lockmode,check,OIDOldToast);
37973798
}
37983799

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp