Skip to content

Commit 1f06b7f

Browse files
committed
Avoid compiler warning in non-assert builds
After 01575ad, 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
1 parent 611806c commit 1f06b7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/optimizer/util/inherit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ expand_single_inheritance_child(PlannerInfo *root, RangeTblEntry *parentrte,
457457
Index *childRTindex_p)
458458
{
459459
Query *parse = root->parse;
460-
Oid parentOID = RelationGetRelid(parentrel);
460+
Oid parentOID PG_USED_FOR_ASSERTS_ONLY =
461+
RelationGetRelid(parentrel);
461462
Oid childOID = RelationGetRelid(childrel);
462463
RangeTblEntry *childrte;
463464
Index childRTindex;

0 commit comments

Comments
 (0)