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

Commit a873da4

Browse files
committed
Fix for select bug.
1 parent 96c4212 commit a873da4

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

src/backend/parser/parse_target.c

+22-20
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.24 1998/08/25 03:22:49 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.25 1998/08/26 03:17:32 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -575,28 +575,30 @@ printf("transformTargetList: decode T_Ident\n");
575575
lnext(tail_p_target) = ExpandAllTables(pstate);
576576
expand_star = true;
577577
}
578-
579-
/*
580-
* Target item is relation.*, expand the table (eg.
581-
* SELECT emp.*, dname FROM emp, dept)
582-
*/
583-
attrname = strVal(lfirst(att->attrs));
584-
if (att->attrs != NIL && !strcmp(attrname, "*"))
578+
else
585579
{
586-
587580
/*
588-
* tail_p_target is the target list we're building
589-
* in the while loop. Make sure we fix it after
590-
* appending more nodes.
581+
* Target item is relation.*, expand the table (eg.
582+
* SELECT emp.*, dname FROM emp, dept)
591583
*/
592-
if (tail_p_target == NIL)
593-
p_target = tail_p_target = expandAll(pstate, att->relname,
594-
att->relname, &pstate->p_last_resno);
595-
else
596-
lnext(tail_p_target) =
597-
expandAll(pstate, att->relname, att->relname,
598-
&pstate->p_last_resno);
599-
expand_star = true;
584+
attrname = strVal(lfirst(att->attrs));
585+
if (att->attrs != NIL && !strcmp(attrname, "*"))
586+
{
587+
588+
/*
589+
* tail_p_target is the target list we're building
590+
* in the while loop. Make sure we fix it after
591+
* appending more nodes.
592+
*/
593+
if (tail_p_target == NIL)
594+
p_target = tail_p_target = expandAll(pstate, att->relname,
595+
att->relname, &pstate->p_last_resno);
596+
else
597+
lnext(tail_p_target) =
598+
expandAll(pstate, att->relname, att->relname,
599+
&pstate->p_last_resno);
600+
expand_star = true;
601+
}
600602
}
601603
if (expand_star)
602604
{

0 commit comments

Comments
 (0)