Skip to content

Commit 183c869

Browse files
committed
adjust_partition_colnos mustn't be called if not needed
Add an assert to make this very explicit, as well as a code comment. The former should silence Coverity complaining about this. Introduced by 7103ebb. Reported-by: Ranier Vilela Discussion: https://postgr.es/m/CAEudQAqTTAOzXiYybab+1DQOb3ZUuK99=p_KD+yrRFhcDbd0jg@mail.gmail.com
1 parent 4533de3 commit 183c869

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/executor/execPartition.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,19 +1530,25 @@ ExecBuildSlotPartitionKeyDescription(Relation rel,
15301530
* adjust_partition_colnos
15311531
* Adjust the list of UPDATE target column numbers to account for
15321532
* attribute differences between the parent and the partition.
1533+
*
1534+
* Note: mustn't be called if no adjustment is required.
15331535
*/
15341536
static List *
15351537
adjust_partition_colnos(List *colnos, ResultRelInfo *leaf_part_rri)
15361538
{
15371539
TupleConversionMap *map = ExecGetChildToRootMap(leaf_part_rri);
15381540

1541+
Assert(map != NULL);
1542+
15391543
return adjust_partition_colnos_using_map(colnos, map->attrMap);
15401544
}
15411545

15421546
/*
15431547
* adjust_partition_colnos_using_map
15441548
* Like adjust_partition_colnos, but uses a caller-supplied map instead
15451549
* of assuming to map from the "root" result relation.
1550+
*
1551+
* Note: mustn't be called if no adjustment is required.
15461552
*/
15471553
static List *
15481554
adjust_partition_colnos_using_map(List *colnos, AttrMap *attrMap)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy