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

Commit 096f1cc

Browse files
committed
Always initialize PartitionBoundInfoData's null_index.
This doesn't actually matter at present, because the current code never consults null_index for range partitions. However, leaving it uninitialized is still a bad idea, so let's not do that. Amul Sul, reviewed by Ashutosh Bapat Discussion: http://postgr.es/m/CAAJ_b94AkEzcx+12ySCnbMDX7=UdF4BjnoBGfMQbB0RNSTo3Ng@mail.gmail.com
1 parent b6263cd commit 096f1cc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/backend/catalog/partition.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ RelationBuildPartitionDesc(Relation rel)
454454
palloc0(sizeof(PartitionBoundInfoData));
455455
boundinfo->strategy = key->strategy;
456456
boundinfo->ndatums = ndatums;
457+
boundinfo->null_index = -1;
457458
boundinfo->datums = (Datum **) palloc0(ndatums * sizeof(Datum *));
458459

459460
/* Initialize mapping array with invalid values */
@@ -503,8 +504,6 @@ RelationBuildPartitionDesc(Relation rel)
503504
mapping[null_index] = next_index++;
504505
boundinfo->null_index = mapping[null_index];
505506
}
506-
else
507-
boundinfo->null_index = -1;
508507

509508
/* All partition must now have a valid mapping */
510509
Assert(next_index == nparts);

0 commit comments

Comments
 (0)