diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-06-13 12:36:45 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-06-13 12:39:20 -0400 |
commit | 096f1ccd5290286b135822bb282fa884454d4b69 (patch) | |
tree | 8abeda6ea791b2b7dcd0f046bb2d04b3f4954c87 /src | |
parent | b6263cd851ef245a5dc38119448e029ca1592da4 (diff) | |
download | postgresql-096f1ccd5290286b135822bb282fa884454d4b69.tar.gz postgresql-096f1ccd5290286b135822bb282fa884454d4b69.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/partition.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c index 5c5a9e11ab1..a7c9b9a46c1 100644 --- a/src/backend/catalog/partition.c +++ b/src/backend/catalog/partition.c @@ -454,6 +454,7 @@ RelationBuildPartitionDesc(Relation rel) palloc0(sizeof(PartitionBoundInfoData)); boundinfo->strategy = key->strategy; boundinfo->ndatums = ndatums; + boundinfo->null_index = -1; boundinfo->datums = (Datum **) palloc0(ndatums * sizeof(Datum *)); /* Initialize mapping array with invalid values */ @@ -503,8 +504,6 @@ RelationBuildPartitionDesc(Relation rel) mapping[null_index] = next_index++; boundinfo->null_index = mapping[null_index]; } - else - boundinfo->null_index = -1; /* All partition must now have a valid mapping */ Assert(next_index == nparts); |