diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-11-11 20:31:26 +0000 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-11-11 20:31:26 +0000 |
commit | e9984c47e94dc3bc06a15e654a525110f12883e8 (patch) | |
tree | c4923db25bbb3f772a0802e4265ce9609344ca64 /src/interfaces/ecpg/preproc | |
parent | af054db6ef2cddb821bb0b0f50db9e6d4d39bc3d (diff) |
Change "name" nonterminal in cursor-related productions to cursor_name.
This is a preparatory patch for allowing a dynamic cursor name be used in the
ECPG grammar.
Author: Zoltan Boszormenyi
Diffstat (limited to 'src/interfaces/ecpg/preproc')
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.addons | 36 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.trailer | 6 |
2 files changed, 21 insertions, 21 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons index 9ef3d191009..1c610f3dd56 100644 --- a/src/interfaces/ecpg/preproc/ecpg.addons +++ b/src/interfaces/ecpg/preproc/ecpg.addons @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.7 2009/11/11 19:25:40 alvherre Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.8 2009/11/11 20:31:26 alvherre Exp $ */ ECPG: stmtClosePortalStmt block { @@ -211,32 +211,32 @@ ECPG: var_valueNumericOnly addon free($1); $1 = make_str("$0"); } -ECPG: fetch_argsname addon +ECPG: fetch_argscursor_name addon add_additional_variables($1, false); -ECPG: fetch_argsfrom_inname addon +ECPG: fetch_argsfrom_incursor_name addon add_additional_variables($2, false); -ECPG: fetch_argsNEXTopt_from_inname addon -ECPG: fetch_argsPRIORopt_from_inname addon -ECPG: fetch_argsFIRST_Popt_from_inname addon -ECPG: fetch_argsLAST_Popt_from_inname addon -ECPG: fetch_argsALLopt_from_inname addon -ECPG: fetch_argsFORWARDopt_from_inname addon -ECPG: fetch_argsBACKWARDopt_from_inname addon +ECPG: fetch_argsNEXTopt_from_incursor_name addon +ECPG: fetch_argsPRIORopt_from_incursor_name addon +ECPG: fetch_argsFIRST_Popt_from_incursor_name addon +ECPG: fetch_argsLAST_Popt_from_incursor_name addon +ECPG: fetch_argsALLopt_from_incursor_name addon +ECPG: fetch_argsFORWARDopt_from_incursor_name addon +ECPG: fetch_argsBACKWARDopt_from_incursor_name addon add_additional_variables($3, false); -ECPG: fetch_argsSignedIconstopt_from_inname addon +ECPG: fetch_argsSignedIconstopt_from_incursor_name addon add_additional_variables($3, false); if ($1[0] == '$') { free($1); $1 = make_str("$0"); } -ECPG: fetch_argsFORWARDALLopt_from_inname addon -ECPG: fetch_argsBACKWARDALLopt_from_inname addon +ECPG: fetch_argsFORWARDALLopt_from_incursor_name addon +ECPG: fetch_argsBACKWARDALLopt_from_incursor_name addon add_additional_variables($4, false); -ECPG: fetch_argsABSOLUTE_PSignedIconstopt_from_inname addon -ECPG: fetch_argsRELATIVE_PSignedIconstopt_from_inname addon -ECPG: fetch_argsFORWARDSignedIconstopt_from_inname addon -ECPG: fetch_argsBACKWARDSignedIconstopt_from_inname addon +ECPG: fetch_argsABSOLUTE_PSignedIconstopt_from_incursor_name addon +ECPG: fetch_argsRELATIVE_PSignedIconstopt_from_incursor_name addon +ECPG: fetch_argsFORWARDSignedIconstopt_from_incursor_name addon +ECPG: fetch_argsBACKWARDSignedIconstopt_from_incursor_name addon add_additional_variables($4, false); if ($2[0] == '$') { @@ -257,7 +257,7 @@ ECPG: PrepareStmtPREPAREprepared_nameprep_type_clauseASPreparableStmt block } ECPG: ExecuteStmtEXECUTEprepared_nameexecute_param_clauseexecute_rest block { $$ = $2; } -ECPG: DeclareCursorStmtDECLAREnamecursor_optionsCURSORopt_holdFORSelectStmt block +ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectStmt block { struct cursor *ptr, *this; char *comment; diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index eca263b2491..dc63c21bab1 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.13 2009/11/05 23:24:27 tgl Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.14 2009/11/11 20:31:26 alvherre Exp $ */ statements: /*EMPTY*/ | statements statement @@ -275,7 +275,7 @@ prepared_name: name { * Declare a prepared cursor. The syntax is different from the standard * declare statement, so we create a new rule. */ -ECPGCursorStmt: DECLARE name cursor_options CURSOR opt_hold FOR prepared_name +ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared_name { struct cursor *ptr, *this; struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable)); @@ -947,7 +947,7 @@ ECPGFree: SQL_FREE name { $$ = $2; } /* * open is an open cursor, at the moment this has to be removed */ -ECPGOpen: SQL_OPEN name opt_ecpg_using { $$ = $2; }; +ECPGOpen: SQL_OPEN cursor_name opt_ecpg_using { $$ = $2; }; opt_ecpg_using: /*EMPTY*/ { $$ = EMPTY; } | ecpg_using { $$ = $1; } |