mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Correct error in grammar for subselect-in-FROM: SQL spec does not allow
omission of alias_clause for a subselect.
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -3751,6 +3751,10 @@ from_list: from_list ',' table_ref { $$ = lappend($1, $3); }
|
|||||||
* between table_ref := '(' joined_table ')' alias_clause
|
* between table_ref := '(' joined_table ')' alias_clause
|
||||||
* and joined_table := '(' joined_table ')'. So, we must have the
|
* and joined_table := '(' joined_table ')'. So, we must have the
|
||||||
* redundant-looking productions here instead.
|
* 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
|
table_ref: relation_expr
|
||||||
{
|
{
|
||||||
@ -3761,13 +3765,6 @@ table_ref: relation_expr
|
|||||||
$1->name = $2;
|
$1->name = $2;
|
||||||
$$ = (Node *) $1;
|
$$ = (Node *) $1;
|
||||||
}
|
}
|
||||||
| '(' select_clause ')'
|
|
||||||
{
|
|
||||||
RangeSubselect *n = makeNode(RangeSubselect);
|
|
||||||
n->subquery = $2;
|
|
||||||
n->name = NULL;
|
|
||||||
$$ = (Node *) n;
|
|
||||||
}
|
|
||||||
| '(' select_clause ')' alias_clause
|
| '(' select_clause ')' alias_clause
|
||||||
{
|
{
|
||||||
RangeSubselect *n = makeNode(RangeSubselect);
|
RangeSubselect *n = makeNode(RangeSubselect);
|
||||||
|
Reference in New Issue
Block a user