Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 16239c5

Browse files
committed
Ensure interleaved_parts field is always initialized
This field was recently added in db632fb, however that commit missed one place where it should have initialized the new field to NULL. The missed location is where the PartitionBoundInfo is created for partition-wise join relations. Technically there could be interleaved partitions in a partition-wise join relation, but currently the only optimization we use this field for only does so for base rels and other member rels. So just document that we don't populate this field for join rels. Reported-by: Amit Langote Author: Amit Langote, David Rowley Reviewed-by: Amit Langote, David Rowley Discussion: https://postgr.es/m/CA+HiwqE76Rps24kwHsd2Cr82Ua07tJC9t9reG0c7ScX9n_xrEA@mail.gmail.com
1 parent 20f8671 commit 16239c5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/backend/partitioning/partbounds.c

+3
Original file line numberDiff line numberDiff line change
@@ -2564,6 +2564,9 @@ build_merged_partition_bounds(char strategy, List *merged_datums,
25642564
merged_bounds->kind = NULL;
25652565
}
25662566

2567+
/* interleaved_parts is always NULL for join relations. */
2568+
merged_bounds->interleaved_parts = NULL;
2569+
25672570
Assert(list_length(merged_indexes) == ndatums);
25682571
merged_bounds->nindexes = ndatums;
25692572
merged_bounds->indexes = (int *) palloc(sizeof(int) * ndatums);

src/include/partitioning/partbounds.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ struct RelOptInfo; /* avoid including pathnodes.h here */
7272
* contain any value that does not belong in another partition. This field
7373
* only serves as proof that a particular partition is not interleaved, not
7474
* proof that it is interleaved. When we're uncertain, we marked the
75-
* partition as interleaved.
75+
* partition as interleaved. The interleaved_parts field is only ever set for
76+
* RELOPT_BASEREL and RELOPT_OTHER_MEMBER_REL, it is always left NULL for join
77+
* relations.
7678
*/
7779
typedef struct PartitionBoundInfoData
7880
{

0 commit comments

Comments
 (0)