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

Commita1888b5

Browse files
committed
Sync addRangeTableEntryForENR() with its peer functions.
addRangeTableEntryForENR had a check for pstate != NULL, which Coveritypointed out was rather useless since it'd already dereferenced pstatebefore that. More to the point, we'd established policy in commitbc93ac1 that we'd require non-NULL pstate for all addRangeTableEntryFor*functions; this test was evidently copied-and-pasted from some olderversion of one of those functions. Make it look more like the others.In passing, make an elog message look more like the rest of the code,too.Michael Paquier
1 parent033b969 commita1888b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/backend/parser/parse_relation.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,11 +1986,12 @@ addRangeTableEntryForENR(ParseState *pstate,
19861986
RangeTblEntry*rte=makeNode(RangeTblEntry);
19871987
Alias*alias=rv->alias;
19881988
char*refname=alias ?alias->aliasname :rv->relname;
1989-
EphemeralNamedRelationMetadataenrmd=
1990-
get_visible_ENR(pstate,rv->relname);
1989+
EphemeralNamedRelationMetadataenrmd;
19911990
TupleDesctupdesc;
19921991
intattno;
19931992

1993+
Assert(pstate!=NULL);
1994+
enrmd=get_visible_ENR(pstate,rv->relname);
19941995
Assert(enrmd!=NULL);
19951996

19961997
switch (enrmd->enrtype)
@@ -2000,7 +2001,7 @@ addRangeTableEntryForENR(ParseState *pstate,
20002001
break;
20012002

20022003
default:
2003-
elog(ERROR,"unexpected enrtype of %i",enrmd->enrtype);
2004+
elog(ERROR,"unexpected enrtype: %d",enrmd->enrtype);
20042005
returnNULL;/* for fussy compilers */
20052006
}
20062007

@@ -2056,8 +2057,7 @@ addRangeTableEntryForENR(ParseState *pstate,
20562057
* Add completed RTE to pstate's range table list, but not to join list
20572058
* nor namespace --- caller must do that if appropriate.
20582059
*/
2059-
if (pstate!=NULL)
2060-
pstate->p_rtable=lappend(pstate->p_rtable,rte);
2060+
pstate->p_rtable=lappend(pstate->p_rtable,rte);
20612061

20622062
returnrte;
20632063
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp