aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-27 17:42:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-27 17:42:03 +0000
commita62a359ba2689ac01271d23f80aed74573e47d15 (patch)
treee661e4011915b83843d10843e6fa8a9898b9f7b9 /src/backend/parser/parse_target.c
parent03a91e0d106c1d328f74f21af208219aa0df60fd (diff)
downloadpostgresql-a62a359ba2689ac01271d23f80aed74573e47d15.tar.gz
postgresql-a62a359ba2689ac01271d23f80aed74573e47d15.zip
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.
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r--src/backend/parser/parse_target.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 6623ac6ed33..af26c4c1c92 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.155 2007/09/06 17:31:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.156 2007/09/27 17:42:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -826,9 +826,12 @@ ExpandColumnRefStar(ParseState *pstate, ColumnRef *cref,
* (e.g., SELECT * FROM emp, dept)
*
* Since the grammar only accepts bare '*' at top level of SELECT, we
- * need not handle the targetlist==false case here.
+ * need not handle the targetlist==false case here. However, we must
+ * test for it because the grammar currently fails to distinguish
+ * a quoted name "*" from a real asterisk.
*/
- Assert(targetlist);
+ if (!targetlist)
+ elog(ERROR, "invalid use of *");
return ExpandAllTables(pstate);
}