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

Commit4e15cb8

Browse files
peterepull[bot]
authored andcommitted
Add const to values and nulls arguments
This excludes any changes that would change the external AM APIs.Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>Discussion:https://www.postgresql.org/message-id/flat/14c31f4a-0347-0805-dce8-93a9072c05a5%40eisentraut.org
1 parentca3e350 commit4e15cb8

File tree

28 files changed

+83
-83
lines changed

28 files changed

+83
-83
lines changed

‎src/backend/access/brin/brin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static void union_tuples(BrinDesc *bdesc, BrinMemTuple *a,
8080
BrinTuple*b);
8181
staticvoidbrin_vacuum_scan(Relationidxrel,BufferAccessStrategystrategy);
8282
staticbooladd_values_to_range(RelationidxRel,BrinDesc*bdesc,
83-
BrinMemTuple*dtup,Datum*values,bool*nulls);
83+
BrinMemTuple*dtup,constDatum*values,constbool*nulls);
8484
staticboolcheck_null_keys(BrinValues*bval,ScanKey*nullkeys,intnnullkeys);
8585

8686
/*
@@ -1774,7 +1774,7 @@ brin_vacuum_scan(Relation idxrel, BufferAccessStrategy strategy)
17741774

17751775
staticbool
17761776
add_values_to_range(RelationidxRel,BrinDesc*bdesc,BrinMemTuple*dtup,
1777-
Datum*values,bool*nulls)
1777+
constDatum*values,constbool*nulls)
17781778
{
17791779
intkeyno;
17801780

‎src/backend/access/common/heaptuple.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ getmissingattr(TupleDesc tupleDesc,
205205
*/
206206
Size
207207
heap_compute_data_size(TupleDesctupleDesc,
208-
Datum*values,
209-
bool*isnull)
208+
constDatum*values,
209+
constbool*isnull)
210210
{
211211
Sizedata_length=0;
212212
inti;
@@ -390,7 +390,7 @@ fill_val(Form_pg_attribute att,
390390
*/
391391
void
392392
heap_fill_tuple(TupleDesctupleDesc,
393-
Datum*values,bool*isnull,
393+
constDatum*values,constbool*isnull,
394394
char*data,Sizedata_size,
395395
uint16*infomask,bits8*bit)
396396
{
@@ -1106,8 +1106,8 @@ heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
11061106
*/
11071107
HeapTuple
11081108
heap_form_tuple(TupleDesctupleDescriptor,
1109-
Datum*values,
1110-
bool*isnull)
1109+
constDatum*values,
1110+
constbool*isnull)
11111111
{
11121112
HeapTupletuple;/* return tuple */
11131113
HeapTupleHeadertd;/* tuple data */
@@ -1200,9 +1200,9 @@ heap_form_tuple(TupleDesc tupleDescriptor,
12001200
HeapTuple
12011201
heap_modify_tuple(HeapTupletuple,
12021202
TupleDesctupleDesc,
1203-
Datum*replValues,
1204-
bool*replIsnull,
1205-
bool*doReplace)
1203+
constDatum*replValues,
1204+
constbool*replIsnull,
1205+
constbool*doReplace)
12061206
{
12071207
intnumberOfAttributes=tupleDesc->natts;
12081208
intattoff;
@@ -1269,9 +1269,9 @@ HeapTuple
12691269
heap_modify_tuple_by_cols(HeapTupletuple,
12701270
TupleDesctupleDesc,
12711271
intnCols,
1272-
int*replCols,
1273-
Datum*replValues,
1274-
bool*replIsnull)
1272+
constint*replCols,
1273+
constDatum*replValues,
1274+
constbool*replIsnull)
12751275
{
12761276
intnumberOfAttributes=tupleDesc->natts;
12771277
Datum*values;
@@ -1442,8 +1442,8 @@ heap_freetuple(HeapTuple htup)
14421442
*/
14431443
MinimalTuple
14441444
heap_form_minimal_tuple(TupleDesctupleDescriptor,
1445-
Datum*values,
1446-
bool*isnull)
1445+
constDatum*values,
1446+
constbool*isnull)
14471447
{
14481448
MinimalTupletuple;/* return tuple */
14491449
Sizelen,

‎src/backend/access/common/indextuple.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
*/
4343
IndexTuple
4444
index_form_tuple(TupleDesctupleDescriptor,
45-
Datum*values,
46-
bool*isnull)
45+
constDatum*values,
46+
constbool*isnull)
4747
{
4848
returnindex_form_tuple_context(tupleDescriptor,values,isnull,
4949
CurrentMemoryContext);
@@ -63,8 +63,8 @@ index_form_tuple(TupleDesc tupleDescriptor,
6363
*/
6464
IndexTuple
6565
index_form_tuple_context(TupleDesctupleDescriptor,
66-
Datum*values,
67-
bool*isnull,
66+
constDatum*values,
67+
constbool*isnull,
6868
MemoryContextcontext)
6969
{
7070
char*tp;/* tuple pointer */
@@ -79,8 +79,8 @@ index_form_tuple_context(TupleDesc tupleDescriptor,
7979
intnumberOfAttributes=tupleDescriptor->natts;
8080

8181
#ifdefTOAST_INDEX_HACK
82-
Datumuntoasted_values[INDEX_MAX_KEYS];
83-
booluntoasted_free[INDEX_MAX_KEYS];
82+
Datumuntoasted_values[INDEX_MAX_KEYS]= {0};
83+
booluntoasted_free[INDEX_MAX_KEYS]= {0};
8484
#endif
8585

8686
if (numberOfAttributes>INDEX_MAX_KEYS)

‎src/backend/access/gist/gistutil.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
573573

574574
IndexTuple
575575
gistFormTuple(GISTSTATE*giststate,Relationr,
576-
Datum*attdata,bool*isnull,boolisleaf)
576+
constDatum*attdata,constbool*isnull,boolisleaf)
577577
{
578578
Datumcompatt[INDEX_MAX_KEYS];
579579
IndexTupleres;
@@ -594,7 +594,7 @@ gistFormTuple(GISTSTATE *giststate, Relation r,
594594

595595
void
596596
gistCompressValues(GISTSTATE*giststate,Relationr,
597-
Datum*attdata,bool*isnull,boolisleaf,Datum*compatt)
597+
constDatum*attdata,constbool*isnull,boolisleaf,Datum*compatt)
598598
{
599599
inti;
600600

‎src/backend/access/hash/hashsort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ _h_spooldestroy(HSpool *hspool)
106106
* spool an index entry into the sort file.
107107
*/
108108
void
109-
_h_spool(HSpool*hspool,ItemPointerself,Datum*values,bool*isnull)
109+
_h_spool(HSpool*hspool,ItemPointerself,constDatum*values,constbool*isnull)
110110
{
111111
tuplesort_putindextuplevalues(hspool->sortstate,hspool->index,
112112
self,values,isnull);

‎src/backend/access/index/genam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ IndexScanEnd(IndexScanDesc scan)
175175
*/
176176
char*
177177
BuildIndexValueDescription(RelationindexRelation,
178-
Datum*values,bool*isnull)
178+
constDatum*values,constbool*isnull)
179179
{
180180
StringInfoDatabuf;
181181
Form_pg_indexidxrec;

‎src/backend/access/spgist/spgutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ memcpyInnerDatum(void *target, SpGistTypeDesc *att, Datum datum)
788788
*/
789789
Size
790790
SpGistGetLeafTupleSize(TupleDesctupleDescriptor,
791-
Datum*datums,bool*isnulls)
791+
constDatum*datums,constbool*isnulls)
792792
{
793793
Sizesize;
794794
Sizedata_size;
@@ -841,7 +841,7 @@ SpGistGetLeafTupleSize(TupleDesc tupleDescriptor,
841841
*/
842842
SpGistLeafTuple
843843
spgFormLeafTuple(SpGistState*state,ItemPointerheapPtr,
844-
Datum*datums,bool*isnulls)
844+
constDatum*datums,constbool*isnulls)
845845
{
846846
SpGistLeafTupletup;
847847
TupleDesctupleDescriptor=state->leafTupDesc;

‎src/backend/access/table/toast_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ toast_tuple_cleanup(ToastTupleContext *ttc)
316316
* relation.
317317
*/
318318
void
319-
toast_delete_external(Relationrel,Datum*values,bool*isnull,
319+
toast_delete_external(Relationrel,constDatum*values,constbool*isnull,
320320
boolis_speculative)
321321
{
322322
TupleDesctupleDesc=rel->rd_att;

‎src/backend/executor/execIndexing.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ typedef enum
127127
staticboolcheck_exclusion_or_unique_constraint(Relationheap,Relationindex,
128128
IndexInfo*indexInfo,
129129
ItemPointertupleid,
130-
Datum*values,bool*isnull,
130+
constDatum*values,constbool*isnull,
131131
EState*estate,boolnewIndex,
132132
CEOUC_WAIT_MODEwaitMode,
133133
boolviolationOK,
134134
ItemPointerconflictTid);
135135

136-
staticboolindex_recheck_constraint(Relationindex,Oid*constr_procs,
137-
Datum*existing_values,bool*existing_isnull,
138-
Datum*new_values);
136+
staticboolindex_recheck_constraint(Relationindex,constOid*constr_procs,
137+
constDatum*existing_values,constbool*existing_isnull,
138+
constDatum*new_values);
139139
staticboolindex_unchanged_by_update(ResultRelInfo*resultRelInfo,
140140
EState*estate,IndexInfo*indexInfo,
141141
RelationindexRelation);
@@ -684,7 +684,7 @@ static bool
684684
check_exclusion_or_unique_constraint(Relationheap,Relationindex,
685685
IndexInfo*indexInfo,
686686
ItemPointertupleid,
687-
Datum*values,bool*isnull,
687+
constDatum*values,constbool*isnull,
688688
EState*estate,boolnewIndex,
689689
CEOUC_WAIT_MODEwaitMode,
690690
boolviolationOK,
@@ -910,7 +910,7 @@ void
910910
check_exclusion_constraint(Relationheap,Relationindex,
911911
IndexInfo*indexInfo,
912912
ItemPointertupleid,
913-
Datum*values,bool*isnull,
913+
constDatum*values,constbool*isnull,
914914
EState*estate,boolnewIndex)
915915
{
916916
(void)check_exclusion_or_unique_constraint(heap,index,indexInfo,tupleid,
@@ -924,9 +924,9 @@ check_exclusion_constraint(Relation heap, Relation index,
924924
* exclusion condition against the new_values. Returns true if conflict.
925925
*/
926926
staticbool
927-
index_recheck_constraint(Relationindex,Oid*constr_procs,
928-
Datum*existing_values,bool*existing_isnull,
929-
Datum*new_values)
927+
index_recheck_constraint(Relationindex,constOid*constr_procs,
928+
constDatum*existing_values,constbool*existing_isnull,
929+
constDatum*new_values)
930930
{
931931
intindnkeyatts=IndexRelationGetNumberOfKeyAttributes(index);
932932
inti;

‎src/backend/executor/execTuples.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2273,7 +2273,7 @@ begin_tup_output_tupdesc(DestReceiver *dest,
22732273
* write a single tuple
22742274
*/
22752275
void
2276-
do_tup_output(TupOutputState*tstate,Datum*values,bool*isnull)
2276+
do_tup_output(TupOutputState*tstate,constDatum*values,constbool*isnull)
22772277
{
22782278
TupleTableSlot*slot=tstate->slot;
22792279
intnatts=slot->tts_tupleDescriptor->natts;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp