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

Commita62a359

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 thatgram.y should try harder to distinguish * from "*" --- the latter is a legalcolumn name per spec, and someday we ought to treat it that way. Howeverfixing that is too invasive for a back-patch, and it's too late for the 8.3cycle too. So just reduce the Assert to a plain elog for now. Per reportfrom NikhilS.
1 parent03a91e0 commita62a359

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
returnExpandAllTables(pstate);
834837
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp