Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 28ae524

Browse files
committed
Quieten warnings about unused variables
These variables are only ever written to in assertion-enabled builds, and the latest Microsoft compilers complain about such variables in non-assertion-enabled builds. Apparently they don't worry so much about variables that are written to but not read from, so most of our PG_USED_FOR_ASSERTS_ONLY variables don't cause the problem. Discussion: https://postgr.es/m/7800.1505950322@sss.pgh.pa.us
1 parent 9140cf8 commit 28ae524

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/backend/optimizer/path/costsize.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -4550,15 +4550,11 @@ set_subquery_size_estimates(PlannerInfo *root, RelOptInfo *rel)
45504550
{
45514551
PlannerInfo *subroot = rel->subroot;
45524552
RelOptInfo *sub_final_rel;
4553-
RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
45544553
ListCell *lc;
45554554

45564555
/* Should only be applied to base relations that are subqueries */
45574556
Assert(rel->relid > 0);
4558-
#ifdef USE_ASSERT_CHECKING
4559-
rte = planner_rt_fetch(rel->relid, root);
4560-
Assert(rte->rtekind == RTE_SUBQUERY);
4561-
#endif
4557+
Assert(planner_rt_fetch(rel->relid, root)->rtekind == RTE_SUBQUERY);
45624558

45634559
/*
45644560
* Copy raw number of output rows from subquery. All of its paths should
@@ -4670,14 +4666,9 @@ set_function_size_estimates(PlannerInfo *root, RelOptInfo *rel)
46704666
void
46714667
set_tablefunc_size_estimates(PlannerInfo *root, RelOptInfo *rel)
46724668
{
4673-
RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
4674-
46754669
/* Should only be applied to base relations that are functions */
46764670
Assert(rel->relid > 0);
4677-
#ifdef USE_ASSERT_CHECKING
4678-
rte = planner_rt_fetch(rel->relid, root);
4679-
Assert(rte->rtekind == RTE_TABLEFUNC);
4680-
#endif
4671+
Assert(planner_rt_fetch(rel->relid, root)->rtekind == RTE_TABLEFUNC);
46814672

46824673
rel->tuples = 100;
46834674

0 commit comments

Comments
 (0)