提交 582e22a8 编写于 作者: M Michael Meskes

Simplified sortby rule

上级 d3e131e0
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.581 2007/03/13 00:33:41 tgl Exp $ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.582 2007/03/17 19:27:12 meskes Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -5982,30 +5982,14 @@ sortby: a_expr USING qual_all_Op opt_nulls_order ...@@ -5982,30 +5982,14 @@ sortby: a_expr USING qual_all_Op opt_nulls_order
$$->sortby_nulls = $4; $$->sortby_nulls = $4;
$$->useOp = $3; $$->useOp = $3;
} }
| a_expr ASC opt_nulls_order | a_expr opt_asc_desc opt_nulls_order
{ {
$$ = makeNode(SortBy); $$ = makeNode(SortBy);
$$->node = $1; $$->node = $1;
$$->sortby_dir = SORTBY_ASC; $$->sortby_dir = $2;
$$->sortby_nulls = $3; $$->sortby_nulls = $3;
$$->useOp = NIL; $$->useOp = NIL;
} }
| a_expr DESC opt_nulls_order
{
$$ = makeNode(SortBy);
$$->node = $1;
$$->sortby_dir = SORTBY_DESC;
$$->sortby_nulls = $3;
$$->useOp = NIL;
}
| a_expr opt_nulls_order
{
$$ = makeNode(SortBy);
$$->node = $1;
$$->sortby_dir = SORTBY_DEFAULT;
$$->sortby_nulls = $2;
$$->useOp = NIL;
}
; ;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册