Skip to content

Commit

Permalink
A small tweak to some comments for PartitionKeyData
Browse files Browse the repository at this point in the history
It was not really that obvious that there's meant to be exactly 1 item
in the partexprs List for each zero-valued partattrs element.  Some
incorrect code using these fields was the cause of CVE-2018-1052, so
it's worthwhile to mention how they should be used in the comments.

Author: David Rowley <david.rowley@2ndquadrant.com>
  • Loading branch information
petere committed Nov 15, 2018
1 parent 52d8e89 commit 7ac0069
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/include/utils/partcache.h
Expand Up @@ -26,9 +26,9 @@ typedef struct PartitionKeyData
char strategy; /* partitioning strategy */
int16 partnatts; /* number of columns in the partition key */
AttrNumber *partattrs; /* attribute numbers of columns in the
* partition key */
* partition key or 0 if it's an expr */
List *partexprs; /* list of expressions in the partitioning
* key, or NIL */
* key, one for each zero-valued partattrs */

Oid *partopfamily; /* OIDs of operator families */
Oid *partopcintype; /* OIDs of opclass declared input data types */
Expand Down

0 comments on commit 7ac0069

Please sign in to comment.