提交 e353e737 编写于 作者: T Tom Lane

Correct error in grammar for subselect-in-FROM: SQL spec does not allow

omission of alias_clause for a subselect.
上级 8bdc2bf0
......@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.191 2000/09/19 18:17:55 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.192 2000/09/25 18:38:39 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
......@@ -3751,6 +3751,10 @@ from_list: from_list ',' table_ref { $$ = lappend($1, $3); }
* between table_ref := '(' joined_table ')' alias_clause
* and joined_table := '(' joined_table ')'. So, we must have the
* redundant-looking productions here instead.
*
* Note that the SQL spec does not permit a subselect (<derived_table>)
* without an alias clause, so we don't either. This avoids the problem
* of needing to invent a refname for an unlabeled subselect.
*/
table_ref: relation_expr
{
......@@ -3761,13 +3765,6 @@ table_ref: relation_expr
$1->name = $2;
$$ = (Node *) $1;
}
| '(' select_clause ')'
{
RangeSubselect *n = makeNode(RangeSubselect);
n->subquery = $2;
n->name = NULL;
$$ = (Node *) n;
}
| '(' select_clause ')' alias_clause
{
RangeSubselect *n = makeNode(RangeSubselect);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册