@@ -1245,6 +1245,8 @@ addRangeTableEntryForRelation(ParseState *pstate,
1245
1245
RangeTblEntry * rte = makeNode (RangeTblEntry );
1246
1246
char * refname = alias ? alias -> aliasname : RelationGetRelationName (rel );
1247
1247
1248
+ Assert (pstate != NULL );
1249
+
1248
1250
rte -> rtekind = RTE_RELATION ;
1249
1251
rte -> alias = alias ;
1250
1252
rte -> relid = RelationGetRelid (rel );
@@ -1276,8 +1278,7 @@ addRangeTableEntryForRelation(ParseState *pstate,
1276
1278
* Add completed RTE to pstate's range table list, but not to join list
1277
1279
* nor namespace --- caller must do that if appropriate.
1278
1280
*/
1279
- if (pstate != NULL )
1280
- pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1281
+ pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1281
1282
1282
1283
return rte ;
1283
1284
}
@@ -1302,6 +1303,8 @@ addRangeTableEntryForSubquery(ParseState *pstate,
1302
1303
int varattno ;
1303
1304
ListCell * tlistitem ;
1304
1305
1306
+ Assert (pstate != NULL );
1307
+
1305
1308
rte -> rtekind = RTE_SUBQUERY ;
1306
1309
rte -> relid = InvalidOid ;
1307
1310
rte -> subquery = subquery ;
@@ -1354,8 +1357,7 @@ addRangeTableEntryForSubquery(ParseState *pstate,
1354
1357
* Add completed RTE to pstate's range table list, but not to join list
1355
1358
* nor namespace --- caller must do that if appropriate.
1356
1359
*/
1357
- if (pstate != NULL )
1358
- pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1360
+ pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1359
1361
1360
1362
return rte ;
1361
1363
}
@@ -1391,6 +1393,8 @@ addRangeTableEntryForFunction(ParseState *pstate,
1391
1393
int natts ,
1392
1394
totalatts ;
1393
1395
1396
+ Assert (pstate != NULL );
1397
+
1394
1398
rte -> rtekind = RTE_FUNCTION ;
1395
1399
rte -> relid = InvalidOid ;
1396
1400
rte -> subquery = NULL ;
@@ -1608,8 +1612,7 @@ addRangeTableEntryForFunction(ParseState *pstate,
1608
1612
* Add completed RTE to pstate's range table list, but not to join list
1609
1613
* nor namespace --- caller must do that if appropriate.
1610
1614
*/
1611
- if (pstate != NULL )
1612
- pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1615
+ pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1613
1616
1614
1617
return rte ;
1615
1618
}
@@ -1633,6 +1636,8 @@ addRangeTableEntryForValues(ParseState *pstate,
1633
1636
int numaliases ;
1634
1637
int numcolumns ;
1635
1638
1639
+ Assert (pstate != NULL );
1640
+
1636
1641
rte -> rtekind = RTE_VALUES ;
1637
1642
rte -> relid = InvalidOid ;
1638
1643
rte -> subquery = NULL ;
@@ -1680,8 +1685,7 @@ addRangeTableEntryForValues(ParseState *pstate,
1680
1685
* Add completed RTE to pstate's range table list, but not to join list
1681
1686
* nor namespace --- caller must do that if appropriate.
1682
1687
*/
1683
- if (pstate != NULL )
1684
- pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1688
+ pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1685
1689
1686
1690
return rte ;
1687
1691
}
@@ -1703,6 +1707,8 @@ addRangeTableEntryForJoin(ParseState *pstate,
1703
1707
Alias * eref ;
1704
1708
int numaliases ;
1705
1709
1710
+ Assert (pstate != NULL );
1711
+
1706
1712
/*
1707
1713
* Fail if join has too many columns --- we must be able to reference any
1708
1714
* of the columns with an AttrNumber.
@@ -1748,8 +1754,7 @@ addRangeTableEntryForJoin(ParseState *pstate,
1748
1754
* Add completed RTE to pstate's range table list, but not to join list
1749
1755
* nor namespace --- caller must do that if appropriate.
1750
1756
*/
1751
- if (pstate != NULL )
1752
- pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1757
+ pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1753
1758
1754
1759
return rte ;
1755
1760
}
@@ -1774,6 +1779,8 @@ addRangeTableEntryForCTE(ParseState *pstate,
1774
1779
int varattno ;
1775
1780
ListCell * lc ;
1776
1781
1782
+ Assert (pstate != NULL );
1783
+
1777
1784
rte -> rtekind = RTE_CTE ;
1778
1785
rte -> ctename = cte -> ctename ;
1779
1786
rte -> ctelevelsup = levelsup ;
@@ -1848,8 +1855,7 @@ addRangeTableEntryForCTE(ParseState *pstate,
1848
1855
* Add completed RTE to pstate's range table list, but not to join list
1849
1856
* nor namespace --- caller must do that if appropriate.
1850
1857
*/
1851
- if (pstate != NULL )
1852
- pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1858
+ pstate -> p_rtable = lappend (pstate -> p_rtable , rte );
1853
1859
1854
1860
return rte ;
1855
1861
}
0 commit comments