diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2025-10-31 10:45:02 +0100 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2025-10-31 10:47:25 +0100 |
| commit | 8a27d418f8fc08b62f371c1b167efbfbf0a2a24e (patch) | |
| tree | 414b7c6d0f4813aadb4b80f41774131180fe867e /src/include/partitioning/partbounds.h | |
| parent | aa4535307e3d432f44b4c76b8ffebc5a0789250c (diff) | |
Mark function arguments of type "Datum *" as "const Datum *" where possible
Several functions in the codebase accept "Datum *" parameters but do
not modify the pointed-to data. These have been updated to take
"const Datum *" instead, improving type safety and making the
interfaces clearer about their intent. This change helps the compiler
catch accidental modifications and better documents immutability of
arguments.
Most of "Datum *" parameters have a pairing "bool *isnull" parameter,
they are constified as well.
No functional behavior is changed by this patch.
Author: Chao Li <lic@highgo.com>
Discussion: https://www.postgresql.org/message-id/flat/CAEoWx2msfT0knvzUa72ZBwu9LR_RLY4on85w2a9YpE-o2By5HQ@mail.gmail.com
Diffstat (limited to 'src/include/partitioning/partbounds.h')
| -rw-r--r-- | src/include/partitioning/partbounds.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h index 083b6e3a88a..cf93f9e5bef 100644 --- a/src/include/partitioning/partbounds.h +++ b/src/include/partitioning/partbounds.h @@ -130,8 +130,8 @@ extern void check_default_partition_contents(Relation parent, extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc, Oid *partcollation, - Datum *rb_datums, PartitionRangeDatumKind *rb_kind, - Datum *tuple_datums, int n_tuple_datums); + const Datum *rb_datums, PartitionRangeDatumKind *rb_kind, + const Datum *tuple_datums, int n_tuple_datums); extern int partition_list_bsearch(FmgrInfo *partsupfunc, Oid *partcollation, PartitionBoundInfo boundinfo, @@ -139,7 +139,7 @@ extern int partition_list_bsearch(FmgrInfo *partsupfunc, extern int partition_range_datum_bsearch(FmgrInfo *partsupfunc, Oid *partcollation, PartitionBoundInfo boundinfo, - int nvalues, Datum *values, bool *is_equal); + int nvalues, const Datum *values, bool *is_equal); extern int partition_hash_bsearch(PartitionBoundInfo boundinfo, int modulus, int remainder); |
