Skip to content

Commit a9c074b

Browse files
committed
Silence unused variable compiler warning
Fallout from fcec6ca: mark a variable in set_tablefunc_size_estimates as used for asserts only. Also, the planner_rte_fetch() call is pointless with assertions disabled, so enclose it in a USE_ASSERT_CHECKING #ifdef; fix the same problem in set_subquery_size_estimates(). First problem noted by David Rowley, whose compiler is noisier than mine in this regard.
1 parent 895e36b commit a9c074b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/optimizer/path/costsize.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4458,8 +4458,10 @@ set_subquery_size_estimates(PlannerInfo *root, RelOptInfo *rel)
44584458

44594459
/* Should only be applied to base relations that are subqueries */
44604460
Assert(rel->relid > 0);
4461+
#ifdef USE_ASSERT_CHECKING
44614462
rte = planner_rt_fetch(rel->relid, root);
44624463
Assert(rte->rtekind == RTE_SUBQUERY);
4464+
#endif
44634465

44644466
/*
44654467
* Copy raw number of output rows from subquery. All of its paths should
@@ -4571,12 +4573,14 @@ set_function_size_estimates(PlannerInfo *root, RelOptInfo *rel)
45714573
void
45724574
set_tablefunc_size_estimates(PlannerInfo *root, RelOptInfo *rel)
45734575
{
4574-
RangeTblEntry *rte;
4576+
RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
45754577

45764578
/* Should only be applied to base relations that are functions */
45774579
Assert(rel->relid > 0);
4580+
#ifdef USE_ASSERT_CHECKING
45784581
rte = planner_rt_fetch(rel->relid, root);
45794582
Assert(rte->rtekind == RTE_TABLEFUNC);
4583+
#endif
45804584

45814585
rel->tuples = 100;
45824586

0 commit comments

Comments
 (0)