diff options
author | Amit Langote <amitlan@postgresql.org> | 2023-10-26 17:12:24 +0900 |
---|---|---|
committer | Amit Langote <amitlan@postgresql.org> | 2023-10-26 17:32:38 +0900 |
commit | 1f06b7fc6e2bc505bea046ca54a4555ca835d7c9 (patch) | |
tree | 8f0e59423ac3e4ed81c73000ae0c950ac408574e | |
parent | 611806cd726fc92989ac918eac48fd8d684869c7 (diff) | |
download | postgresql-1f06b7fc6e2bc505bea046ca54a4555ca835d7c9.tar.gz postgresql-1f06b7fc6e2bc505bea046ca54a4555ca835d7c9.zip |
Avoid compiler warning in non-assert builds
After 01575ad788e3, expand_single_inheritance_child()'s parentOID
variable is read only in an Assert, provoking a compiler warning in
non-assert builds. Fix that by marking the variable with
PG_USED_FOR_ASSERTS_ONLY.
Per report and suggestion from David Rowley
Discussion: https://postgr.es/m/CAApHDvpjA_8Wxu4DCTRVAvPxC9atwMe6N%2ByvrcGsgb7mrfdpJA%40mail.gmail.com
-rw-r--r-- | src/backend/optimizer/util/inherit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/inherit.c b/src/backend/optimizer/util/inherit.c index 00b65ca305b..f9d3ff1e7ac 100644 --- a/src/backend/optimizer/util/inherit.c +++ b/src/backend/optimizer/util/inherit.c @@ -457,7 +457,8 @@ expand_single_inheritance_child(PlannerInfo *root, RangeTblEntry *parentrte, Index *childRTindex_p) { Query *parse = root->parse; - Oid parentOID = RelationGetRelid(parentrel); + Oid parentOID PG_USED_FOR_ASSERTS_ONLY = + RelationGetRelid(parentrel); Oid childOID = RelationGetRelid(childrel); RangeTblEntry *childrte; Index childRTindex; |