|
10 | 10 | *
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.16 1998/07/24 03:31:23 scrappy Exp $ |
| 13 | + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.17 1998/07/25 00:17:28 momjian Exp $ |
14 | 14 | *
|
15 | 15 | * HISTORY
|
16 | 16 | * AUTHORDATEMAJOR EVENT
|
@@ -175,6 +175,7 @@ Oidparam_type(int t); /* used in parse_expr.c */
|
175 | 175 | join_using
|
176 | 176 | %type <boolean>opt_union
|
177 | 177 | %type <boolean>opt_table
|
| 178 | +%type <boolean>opt_trans |
178 | 179 |
|
179 | 180 | %type <node>position_expr
|
180 | 181 | %type <list>extract_list, position_list
|
@@ -1994,74 +1995,41 @@ ListenStmt: LISTEN relation_name
|
1994 | 1995 | *
|
1995 | 1996 | *****************************************************************************/
|
1996 | 1997 |
|
1997 |
| -TransactionStmt:ABORT_TRANSTRANSACTION |
| 1998 | +TransactionStmt: ABORT_TRANSopt_trans |
1998 | 1999 | {
|
1999 | 2000 | TransactionStmt *n = makeNode(TransactionStmt);
|
2000 | 2001 | n->command = ABORT_TRANS;
|
2001 | 2002 | $$ = (Node *)n;
|
2002 | 2003 | }
|
2003 |
| -| BEGIN_TRANSTRANSACTION |
| 2004 | +| BEGIN_TRANSopt_trans |
2004 | 2005 | {
|
2005 | 2006 | TransactionStmt *n = makeNode(TransactionStmt);
|
2006 | 2007 | n->command = BEGIN_TRANS;
|
2007 | 2008 | $$ = (Node *)n;
|
2008 | 2009 | }
|
2009 |
| -| BEGIN_TRANS WORK |
2010 |
| -{ |
2011 |
| -TransactionStmt *n = makeNode(TransactionStmt); |
2012 |
| -n->command = BEGIN_TRANS; |
2013 |
| -$$ = (Node *)n; |
2014 |
| -} |
2015 |
| -| COMMIT WORK |
| 2010 | +| COMMIT opt_trans |
2016 | 2011 | {
|
2017 | 2012 | TransactionStmt *n = makeNode(TransactionStmt);
|
2018 | 2013 | n->command = END_TRANS;
|
2019 | 2014 | $$ = (Node *)n;
|
2020 | 2015 | }
|
2021 |
| -| END_TRANSTRANSACTION |
| 2016 | +| END_TRANSopt_trans |
2022 | 2017 | {
|
2023 | 2018 | TransactionStmt *n = makeNode(TransactionStmt);
|
2024 | 2019 | n->command = END_TRANS;
|
2025 | 2020 | $$ = (Node *)n;
|
2026 | 2021 | }
|
2027 |
| -| ROLLBACK WORK |
2028 |
| -{ |
2029 |
| -TransactionStmt *n = makeNode(TransactionStmt); |
2030 |
| -n->command = ABORT_TRANS; |
2031 |
| -$$ = (Node *)n; |
2032 |
| -} |
2033 |
| - |
2034 |
| -| ABORT_TRANS |
| 2022 | +| ROLLBACK opt_trans |
2035 | 2023 | {
|
2036 | 2024 | TransactionStmt *n = makeNode(TransactionStmt);
|
2037 | 2025 | n->command = ABORT_TRANS;
|
2038 | 2026 | $$ = (Node *)n;
|
2039 | 2027 | }
|
2040 |
| -| BEGIN_TRANS |
2041 |
| -{ |
2042 |
| -TransactionStmt *n = makeNode(TransactionStmt); |
2043 |
| -n->command = BEGIN_TRANS; |
2044 |
| -$$ = (Node *)n; |
2045 |
| -} |
2046 |
| -| COMMIT |
2047 |
| -{ |
2048 |
| -TransactionStmt *n = makeNode(TransactionStmt); |
2049 |
| -n->command = END_TRANS; |
2050 |
| -$$ = (Node *)n; |
2051 |
| -} |
| 2028 | +; |
2052 | 2029 |
|
2053 |
| -| END_TRANS |
2054 |
| -{ |
2055 |
| -TransactionStmt *n = makeNode(TransactionStmt); |
2056 |
| -n->command = END_TRANS; |
2057 |
| -$$ = (Node *)n; |
2058 |
| -} |
2059 |
| -| ROLLBACK |
2060 |
| -{ |
2061 |
| -TransactionStmt *n = makeNode(TransactionStmt); |
2062 |
| -n->command = ABORT_TRANS; |
2063 |
| -$$ = (Node *)n; |
2064 |
| -} |
| 2030 | +opt_trans: WORK{ $$ = NULL; } |
| 2031 | +|TRANSACTION{ $$ = NULL: } |
| 2032 | +| /*EMPTY*/{ $$ = NULL; } |
2065 | 2033 | ;
|
2066 | 2034 |
|
2067 | 2035 |
|
|