summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorPeter Eisentraut2023-10-10 05:50:15 +0000
committerPeter Eisentraut2023-10-10 05:50:43 +0000
commit1d91d24d9a831be0bb90ec71934f735c52456c57 (patch)
tree47c9ba51a493bb78cf6695fdf815ea15d2ca24f5 /src/backend/access
parentfc4089f3c65a5f1b413a3299ba02b66a8e5e37d0 (diff)
Add const to values and nulls arguments
This excludes any changes that would change the external AM APIs. Reviewed-by: Aleksander Alekseev <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/14c31f4a-0347-0805-dce8-93a9072c05a5%40eisentraut.org
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/brin/brin.c4
-rw-r--r--src/backend/access/common/heaptuple.c26
-rw-r--r--src/backend/access/common/indextuple.c12
-rw-r--r--src/backend/access/gist/gistutil.c4
-rw-r--r--src/backend/access/hash/hashsort.c2
-rw-r--r--src/backend/access/index/genam.c2
-rw-r--r--src/backend/access/spgist/spgutils.c4
-rw-r--r--src/backend/access/table/toast_helper.c2
8 files changed, 28 insertions, 28 deletions
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index a7538f32c2e..af392bc032b 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -80,7 +80,7 @@ static void union_tuples(BrinDesc *bdesc, BrinMemTuple *a,
BrinTuple *b);
static void brin_vacuum_scan(Relation idxrel, BufferAccessStrategy strategy);
static bool add_values_to_range(Relation idxRel, BrinDesc *bdesc,
- BrinMemTuple *dtup, Datum *values, bool *nulls);
+ BrinMemTuple *dtup, const Datum *values, const bool *nulls);
static bool check_null_keys(BrinValues *bval, ScanKey *nullkeys, int nnullkeys);
/*
@@ -1774,7 +1774,7 @@ brin_vacuum_scan(Relation idxrel, BufferAccessStrategy strategy)
static bool
add_values_to_range(Relation idxRel, BrinDesc *bdesc, BrinMemTuple *dtup,
- Datum *values, bool *nulls)
+ const Datum *values, const bool *nulls)
{
int keyno;
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index ef246c901e7..d6a4ddfd51f 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -205,8 +205,8 @@ getmissingattr(TupleDesc tupleDesc,
*/
Size
heap_compute_data_size(TupleDesc tupleDesc,
- Datum *values,
- bool *isnull)
+ const Datum *values,
+ const bool *isnull)
{
Size data_length = 0;
int i;
@@ -390,7 +390,7 @@ fill_val(Form_pg_attribute att,
*/
void
heap_fill_tuple(TupleDesc tupleDesc,
- Datum *values, bool *isnull,
+ const Datum *values, const bool *isnull,
char *data, Size data_size,
uint16 *infomask, bits8 *bit)
{
@@ -1106,8 +1106,8 @@ heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
*/
HeapTuple
heap_form_tuple(TupleDesc tupleDescriptor,
- Datum *values,
- bool *isnull)
+ const Datum *values,
+ const bool *isnull)
{
HeapTuple tuple; /* return tuple */
HeapTupleHeader td; /* tuple data */
@@ -1200,9 +1200,9 @@ heap_form_tuple(TupleDesc tupleDescriptor,
HeapTuple
heap_modify_tuple(HeapTuple tuple,
TupleDesc tupleDesc,
- Datum *replValues,
- bool *replIsnull,
- bool *doReplace)
+ const Datum *replValues,
+ const bool *replIsnull,
+ const bool *doReplace)
{
int numberOfAttributes = tupleDesc->natts;
int attoff;
@@ -1269,9 +1269,9 @@ HeapTuple
heap_modify_tuple_by_cols(HeapTuple tuple,
TupleDesc tupleDesc,
int nCols,
- int *replCols,
- Datum *replValues,
- bool *replIsnull)
+ const int *replCols,
+ const Datum *replValues,
+ const bool *replIsnull)
{
int numberOfAttributes = tupleDesc->natts;
Datum *values;
@@ -1442,8 +1442,8 @@ heap_freetuple(HeapTuple htup)
*/
MinimalTuple
heap_form_minimal_tuple(TupleDesc tupleDescriptor,
- Datum *values,
- bool *isnull)
+ const Datum *values,
+ const bool *isnull)
{
MinimalTuple tuple; /* return tuple */
Size len,
diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c
index 8b178f94c17..9e9f87b134e 100644
--- a/src/backend/access/common/indextuple.c
+++ b/src/backend/access/common/indextuple.c
@@ -42,8 +42,8 @@
*/
IndexTuple
index_form_tuple(TupleDesc tupleDescriptor,
- Datum *values,
- bool *isnull)
+ const Datum *values,
+ const bool *isnull)
{
return index_form_tuple_context(tupleDescriptor, values, isnull,
CurrentMemoryContext);
@@ -63,8 +63,8 @@ index_form_tuple(TupleDesc tupleDescriptor,
*/
IndexTuple
index_form_tuple_context(TupleDesc tupleDescriptor,
- Datum *values,
- bool *isnull,
+ const Datum *values,
+ const bool *isnull,
MemoryContext context)
{
char *tp; /* tuple pointer */
@@ -79,8 +79,8 @@ index_form_tuple_context(TupleDesc tupleDescriptor,
int numberOfAttributes = tupleDescriptor->natts;
#ifdef TOAST_INDEX_HACK
- Datum untoasted_values[INDEX_MAX_KEYS];
- bool untoasted_free[INDEX_MAX_KEYS];
+ Datum untoasted_values[INDEX_MAX_KEYS] = {0};
+ bool untoasted_free[INDEX_MAX_KEYS] = {0};
#endif
if (numberOfAttributes > INDEX_MAX_KEYS)
diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
index b6bc8c2c56d..9ce3687dbf1 100644
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -573,7 +573,7 @@ gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
IndexTuple
gistFormTuple(GISTSTATE *giststate, Relation r,
- Datum *attdata, bool *isnull, bool isleaf)
+ const Datum *attdata, const bool *isnull, bool isleaf)
{
Datum compatt[INDEX_MAX_KEYS];
IndexTuple res;
@@ -594,7 +594,7 @@ gistFormTuple(GISTSTATE *giststate, Relation r,
void
gistCompressValues(GISTSTATE *giststate, Relation r,
- Datum *attdata, bool *isnull, bool isleaf, Datum *compatt)
+ const Datum *attdata, const bool *isnull, bool isleaf, Datum *compatt)
{
int i;
diff --git a/src/backend/access/hash/hashsort.c b/src/backend/access/hash/hashsort.c
index b67b2207c05..e7c3ab10e40 100644
--- a/src/backend/access/hash/hashsort.c
+++ b/src/backend/access/hash/hashsort.c
@@ -106,7 +106,7 @@ _h_spooldestroy(HSpool *hspool)
* spool an index entry into the sort file.
*/
void
-_h_spool(HSpool *hspool, ItemPointer self, Datum *values, bool *isnull)
+_h_spool(HSpool *hspool, ItemPointer self, const Datum *values, const bool *isnull)
{
tuplesort_putindextuplevalues(hspool->sortstate, hspool->index,
self, values, isnull);
diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c
index 722927aebab..4ca12006843 100644
--- a/src/backend/access/index/genam.c
+++ b/src/backend/access/index/genam.c
@@ -175,7 +175,7 @@ IndexScanEnd(IndexScanDesc scan)
*/
char *
BuildIndexValueDescription(Relation indexRelation,
- Datum *values, bool *isnull)
+ const Datum *values, const bool *isnull)
{
StringInfoData buf;
Form_pg_index idxrec;
diff --git a/src/backend/access/spgist/spgutils.c b/src/backend/access/spgist/spgutils.c
index 8f32e46fb83..c112e1e5dd4 100644
--- a/src/backend/access/spgist/spgutils.c
+++ b/src/backend/access/spgist/spgutils.c
@@ -788,7 +788,7 @@ memcpyInnerDatum(void *target, SpGistTypeDesc *att, Datum datum)
*/
Size
SpGistGetLeafTupleSize(TupleDesc tupleDescriptor,
- Datum *datums, bool *isnulls)
+ const Datum *datums, const bool *isnulls)
{
Size size;
Size data_size;
@@ -841,7 +841,7 @@ SpGistGetLeafTupleSize(TupleDesc tupleDescriptor,
*/
SpGistLeafTuple
spgFormLeafTuple(SpGistState *state, ItemPointer heapPtr,
- Datum *datums, bool *isnulls)
+ const Datum *datums, const bool *isnulls)
{
SpGistLeafTuple tup;
TupleDesc tupleDescriptor = state->leafTupDesc;
diff --git a/src/backend/access/table/toast_helper.c b/src/backend/access/table/toast_helper.c
index b5cfeb21aab..871ebeeb563 100644
--- a/src/backend/access/table/toast_helper.c
+++ b/src/backend/access/table/toast_helper.c
@@ -316,7 +316,7 @@ toast_tuple_cleanup(ToastTupleContext *ttc)
* relation.
*/
void
-toast_delete_external(Relation rel, Datum *values, bool *isnull,
+toast_delete_external(Relation rel, const Datum *values, const bool *isnull,
bool is_speculative)
{
TupleDesc tupleDesc = rel->rd_att;