Skip to content

Commit 7e46348

Browse files
committed
FIx for regression-test found bug.
1 parent 7f31669 commit 7e46348

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/backend/parser/parse_clause.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.11 1998/01/20 22:11:53 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.12 1998/01/20 22:55:25 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -39,15 +39,18 @@ void
3939
makeRangeTable(ParseState *pstate, char *relname, List *frmList)
4040
{
4141
RangeTblEntry *rte;
42+
int sublevels_up;
4243

4344
parseFromClause(pstate, frmList);
4445

4546
if (relname == NULL)
4647
return;
4748

48-
Assert(pstate->p_rtable == NULL);
49-
50-
rte = addRangeTableEntry(pstate, relname, relname, FALSE, FALSE);
49+
if (refnameRangeTablePosn(pstate, relname, &sublevels_up) == 0 ||
50+
sublevels_up != 0)
51+
rte = addRangeTableEntry(pstate, relname, relname, FALSE, FALSE);
52+
else
53+
rte = refnameRangeTableEntry(pstate, relname);
5154

5255
pstate->p_target_rangetblentry = rte;
5356
Assert(pstate->p_target_relation == NULL);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy