Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5223dda

Browse files
committed
Remove residual NULL-pstate handling in addRangeTableEntry.
Passing a NULL pstate wouldn't actually work, because isLockedRefname()isn't prepared to cope with it; and there hasn't been any in-core codethat tries in over a decade. So just remove the residual NULL handling.Spotted by Coverity; analysis and patch by Michael Paquier.
1 parenta2e35b5 commit5223dda

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎src/backend/parser/parse_relation.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -993,9 +993,6 @@ parserOpenTable(ParseState *pstate, const RangeVar *relation, int lockmode)
993993
/*
994994
* Add an entry for a relation to the pstate's range table (p_rtable).
995995
*
996-
* If pstate is NULL, we just build an RTE and return it without adding it
997-
* to an rtable list.
998-
*
999996
* Note: formerly this checked for refname conflicts, but that's wrong.
1000997
* Caller is responsible for checking for conflicts in the appropriate scope.
1001998
*/
@@ -1011,6 +1008,8 @@ addRangeTableEntry(ParseState *pstate,
10111008
LOCKMODElockmode;
10121009
Relationrel;
10131010

1011+
Assert(pstate!=NULL);
1012+
10141013
rte->rtekind=RTE_RELATION;
10151014
rte->alias=alias;
10161015

@@ -1058,8 +1057,7 @@ addRangeTableEntry(ParseState *pstate,
10581057
* Add completed RTE to pstate's range table list, but not to join list
10591058
* nor namespace --- caller must do that if appropriate.
10601059
*/
1061-
if (pstate!=NULL)
1062-
pstate->p_rtable=lappend(pstate->p_rtable,rte);
1060+
pstate->p_rtable=lappend(pstate->p_rtable,rte);
10631061

10641062
returnrte;
10651063
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp