This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 67214d4cab3 Fix conflict for partitioning
67214d4cab3 is described below
commit 67214d4cab30b23be464166b5d3b11662f9bf479
Author: Jinbao Chen <[email protected]>
AuthorDate: Fri Jul 18 15:35:22 2025 +0800
Fix conflict for partitioning
---
src/backend/partitioning/partbounds.c | 43 -----------------------------------
src/backend/partitioning/partdesc.c | 14 ++++--------
2 files changed, 4 insertions(+), 53 deletions(-)
diff --git a/src/backend/partitioning/partbounds.c
b/src/backend/partitioning/partbounds.c
index 9dfa24f828a..d2929283b1a 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -387,10 +387,7 @@ create_hash_bounds(PartitionBoundSpec **boundspecs, int
nparts,
boundinfo->ndatums = nparts;
boundinfo->datums = (Datum **) palloc0(nparts * sizeof(Datum *));
boundinfo->kind = NULL;
-<<<<<<< HEAD
-=======
boundinfo->interleaved_parts = NULL;
->>>>>>> REL_16_9
boundinfo->nindexes = greatest_modulus;
boundinfo->indexes = (int *) palloc(greatest_modulus * sizeof(int));
for (i = 0; i < greatest_modulus; i++)
@@ -448,11 +445,7 @@ get_non_null_list_datum_count(PartitionBoundSpec
**boundspecs, int nparts)
foreach(lc, boundspecs[i]->listdatums)
{
-<<<<<<< HEAD
- Const *val = castNode(Const, lfirst(lc));
-=======
Const *val = lfirst_node(Const, lc);
->>>>>>> REL_16_9
if (!val->constisnull)
count++;
@@ -513,11 +506,7 @@ create_list_bounds(PartitionBoundSpec **boundspecs, int
nparts,
foreach(c, spec->listdatums)
{
-<<<<<<< HEAD
- Const *val = castNode(Const, lfirst(c));
-=======
Const *val = lfirst_node(Const, c);
->>>>>>> REL_16_9
if (!val->constisnull)
{
@@ -542,19 +531,12 @@ create_list_bounds(PartitionBoundSpec **boundspecs, int
nparts,
Assert(j == ndatums);
qsort_arg(all_values, ndatums, sizeof(PartitionListValue),
-<<<<<<< HEAD
- qsort_partition_list_value_cmp, (void *) key);
-=======
qsort_partition_list_value_cmp, key);
->>>>>>> REL_16_9
boundinfo->ndatums = ndatums;
boundinfo->datums = (Datum **) palloc0(ndatums * sizeof(Datum *));
boundinfo->kind = NULL;
-<<<<<<< HEAD
-=======
boundinfo->interleaved_parts = NULL;
->>>>>>> REL_16_9
boundinfo->nindexes = ndatums;
boundinfo->indexes = (int *) palloc(ndatums * sizeof(int));
@@ -1028,11 +1010,7 @@ partition_bounds_copy(PartitionBoundInfo src,
int partnatts;
bool hash_part;
int natts;
-<<<<<<< HEAD
- Datum *boundDatums;
-=======
Datum *boundDatums;
->>>>>>> REL_16_9
dest = (PartitionBoundInfo) palloc(sizeof(PartitionBoundInfoData));
@@ -1049,12 +1027,6 @@ partition_bounds_copy(PartitionBoundInfo src,
if (src->kind != NULL)
{
PartitionRangeDatumKind *boundKinds;
-<<<<<<< HEAD
- /* only RANGE partition should have a non-NULL kind */
- Assert(key->strategy == PARTITION_STRATEGY_RANGE);
- dest->kind = (PartitionRangeDatumKind **) palloc(ndatums *
-
sizeof(PartitionRangeDatumKind *));
-=======
/* only RANGE partition should have a non-NULL kind */
Assert(key->strategy == PARTITION_STRATEGY_RANGE);
@@ -1062,7 +1034,6 @@ partition_bounds_copy(PartitionBoundInfo src,
dest->kind = (PartitionRangeDatumKind **) palloc(ndatums *
sizeof(PartitionRangeDatumKind *));
->>>>>>> REL_16_9
/*
* In the loop below, to save from allocating a series of small
arrays
* for storing the PartitionRangeDatumKind, we allocate a
single chunk
@@ -1070,10 +1041,6 @@ partition_bounds_copy(PartitionBoundInfo src,
*/
boundKinds = (PartitionRangeDatumKind *) palloc(ndatums *
partnatts *
sizeof(PartitionRangeDatumKind));
-<<<<<<< HEAD
-=======
-
->>>>>>> REL_16_9
for (i = 0; i < ndatums; i++)
{
dest->kind[i] = &boundKinds[i * partnatts];
@@ -3810,13 +3777,8 @@ partition_hash_bsearch(PartitionBoundInfo boundinfo,
static int32
qsort_partition_hbound_cmp(const void *a, const void *b)
{
-<<<<<<< HEAD
- PartitionHashBound *const h1 = (PartitionHashBound *const) a;
- PartitionHashBound *const h2 = (PartitionHashBound *const) b;
-=======
const PartitionHashBound *h1 = (const PartitionHashBound *) a;
const PartitionHashBound *h2 = (const PartitionHashBound *) b;
->>>>>>> REL_16_9
return partition_hbound_cmp(h1->modulus, h1->remainder,
h2->modulus,
h2->remainder);
@@ -3830,13 +3792,8 @@ qsort_partition_hbound_cmp(const void *a, const void *b)
static int32
qsort_partition_list_value_cmp(const void *a, const void *b, void *arg)
{
-<<<<<<< HEAD
- Datum val1 = ((PartitionListValue *const) a)->value,
- val2 = ((PartitionListValue *const) b)->value;
-=======
Datum val1 = ((const PartitionListValue *) a)->value,
val2 = ((const PartitionListValue *) b)->value;
->>>>>>> REL_16_9
PartitionKey key = (PartitionKey) arg;
return DatumGetInt32(FunctionCall2Coll(&key->partsupfunc[0],
diff --git a/src/backend/partitioning/partdesc.c
b/src/backend/partitioning/partdesc.c
index 4225af95e4d..ea18702f976 100644
--- a/src/backend/partitioning/partdesc.c
+++ b/src/backend/partitioning/partdesc.c
@@ -272,25 +272,19 @@ retry:
* tuples if the table has been dropped meanwhile.
*/
tuple = systable_getnext(scan);
-<<<<<<< HEAD
- if (!tuple)
- elog(ERROR, "could not find pg_class entry for
oid %u", inhrelid);
- datum = heap_getattr(tuple, Anum_pg_class_relpartbound,
-
RelationGetDescr(pg_class), &isnull);
- if (!isnull)
- boundspec =
stringToNode(TextDatumGetCString(datum));
-=======
- if (HeapTupleIsValid(tuple))
+
{
Datum datum;
bool isnull;
+ if (!tuple)
+ elog(ERROR, "could not find pg_class
entry for oid %u", inhrelid);
datum = heap_getattr(tuple,
Anum_pg_class_relpartbound,
RelationGetDescr(pg_class), &isnull);
if (!isnull)
boundspec =
stringToNode(TextDatumGetCString(datum));
}
->>>>>>> REL_16_9
+
systable_endscan(scan);
table_close(pg_class, AccessShareLock);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]