@ -5115,8 +5115,7 @@ calculate_partition_bound_for_merge(Relation parent,
int nparts = list_length ( partOids ) ;
int nparts = list_length ( partOids ) ;
List * bounds = NIL ;
List * bounds = NIL ;
lower_bounds = ( PartitionRangeBound * * )
lower_bounds = palloc0_array ( PartitionRangeBound * , nparts ) ;
palloc0 ( nparts * sizeof ( PartitionRangeBound * ) ) ;
/*
/*
* Create an array of lower bounds and a list of
* Create an array of lower bounds and a list of
@ -5755,8 +5754,7 @@ check_partitions_for_split(Relation parent,
* Make an array new_parts with new partitions except the DEFAULT
* Make an array new_parts with new partitions except the DEFAULT
* partition .
* partition .
*/
*/
new_parts = ( SinglePartitionSpec * * )
new_parts = palloc0_array ( SinglePartitionSpec * , list_length ( partlist ) ) ;
palloc0 ( list_length ( partlist ) * sizeof ( SinglePartitionSpec * ) ) ;
/* isSplitPartDefault flag: is split partition a DEFAULT partition? */
/* isSplitPartDefault flag: is split partition a DEFAULT partition? */
isSplitPartDefault = ( defaultPartOid = = splitPartOid ) ;
isSplitPartDefault = ( defaultPartOid = = splitPartOid ) ;
@ -5786,8 +5784,7 @@ check_partitions_for_split(Relation parent,
* all partitions in ascending order of their bounds ( we compare the
* all partitions in ascending order of their bounds ( we compare the
* lower bound only ) .
* lower bound only ) .
*/
*/
lower_bounds = ( PartitionRangeBound * * )
lower_bounds = palloc0_array ( PartitionRangeBound * , nparts ) ;
palloc0 ( nparts * sizeof ( PartitionRangeBound * ) ) ;
/* Create an array of lower bounds. */
/* Create an array of lower bounds. */
for ( i = 0 ; i < nparts ; i + + )
for ( i = 0 ; i < nparts ; i + + )
@ -5802,8 +5799,7 @@ check_partitions_for_split(Relation parent,
/* Reorder the array of partitions. */
/* Reorder the array of partitions. */
tmp_new_parts = new_parts ;
tmp_new_parts = new_parts ;
new_parts = ( SinglePartitionSpec * * )
new_parts = palloc0_array ( SinglePartitionSpec * , nparts ) ;
palloc0 ( nparts * sizeof ( SinglePartitionSpec * ) ) ;
for ( i = 0 ; i < nparts ; i + + )
for ( i = 0 ; i < nparts ; i + + )
new_parts [ i ] = tmp_new_parts [ lower_bounds [ i ] - > index ] ;
new_parts [ i ] = tmp_new_parts [ lower_bounds [ i ] - > index ] ;