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

Commit a62a359

Browse files
committed
Fix Assert failure in ExpandColumnRefStar --- what I thought was a can't
happen condition can happen given incorrect input. The real problem is that gram.y should try harder to distinguish * from "*" --- the latter is a legal column name per spec, and someday we ought to treat it that way. However fixing that is too invasive for a back-patch, and it's too late for the 8.3 cycle too. So just reduce the Assert to a plain elog for now. Per report from NikhilS.
1 parent 03a91e0 commit a62a359

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/parser/parse_target.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.155 2007/09/06 17:31:58 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.156 2007/09/27 17:42:03 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -826,9 +826,12 @@ ExpandColumnRefStar(ParseState *pstate, ColumnRef *cref,
826826
* (e.g., SELECT * FROM emp, dept)
827827
*
828828
* Since the grammar only accepts bare '*' at top level of SELECT, we
829-
* need not handle the targetlist==false case here.
829+
* need not handle the targetlist==false case here. However, we must
830+
* test for it because the grammar currently fails to distinguish
831+
* a quoted name "*" from a real asterisk.
830832
*/
831-
Assert(targetlist);
833+
if (!targetlist)
834+
elog(ERROR, "invalid use of *");
832835

833836
return ExpandAllTables(pstate);
834837
}

0 commit comments

Comments
 (0)