Skip to content

Commit bc42387

Browse files
author
Michael Meskes
committed
Applied a patch by Zoltán Böszörményi that makes ecpg's parser accept dynamic cursornames even in WHERE CURRENT OF clauses.
1 parent 5c63982 commit bc42387

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/backend/parser/gram.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9031,7 +9031,7 @@ where_clause:
90319031
/* variant for UPDATE and DELETE */
90329032
where_or_current_clause:
90339033
WHERE a_expr { $$ = $2; }
9034-
| WHERE CURRENT_P OF name
9034+
| WHERE CURRENT_P OF cursor_name
90359035
{
90369036
CurrentOfExpr *n = makeNode(CurrentOfExpr);
90379037
/* cvarno is filled in by parse analysis */

src/interfaces/ecpg/preproc/ecpg.addons

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ ECPG: stmtViewStmt rule
192192

193193
output_simple_statement($1);
194194
}
195+
ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block
196+
{
197+
char *cursor_marker = $4[0] == ':' ? mm_strdup("$0") : $4;
198+
$$ = cat_str(2,mm_strdup("where current of"), cursor_marker);
199+
}
195200
ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listopt_oidscopy_fromcopy_file_namecopy_delimiteropt_withcopy_options addon
196201
if (strcmp($6, "to") == 0 && strcmp($7, "stdin") == 0)
197202
mmerror(PARSE_ERROR, ET_ERROR, "COPY TO STDIN is not possible");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy