Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e01c6ce7
Commit
e01c6ce7
authored
Mar 31, 2010
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give a more precise error message if a variable is re-used as cursor name in ecpg.
parent
d174a4ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
src/interfaces/ecpg/preproc/ecpg.addons
src/interfaces/ecpg/preproc/ecpg.addons
+7
-2
src/interfaces/ecpg/preproc/ecpg.trailer
src/interfaces/ecpg/preproc/ecpg.trailer
+7
-2
No files found.
src/interfaces/ecpg/preproc/ecpg.addons
View file @
e01c6ce7
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.1
8 2010/03/23 22:12:06 petere
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.1
9 2010/03/31 08:45:18 meskes
Exp $ */
ECPG: stmtClosePortalStmt block
{
if (INFORMIX_MODE)
...
...
@@ -306,7 +306,12 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
for (ptr = cur; ptr != NULL; ptr = ptr->next)
{
if (strcmp($2, ptr->name) == 0)
mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
{
if ($2[0] == ':')
mmerror(PARSE_ERROR, ET_ERROR, "using variable \"%s\" in different declare statements is not supported", $2+1);
else
mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
}
}
this = (struct cursor *) mm_alloc(sizeof(struct cursor));
...
...
src/interfaces/ecpg/preproc/ecpg.trailer
View file @
e01c6ce7
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.2
3 2010/03/21 11:56:45
meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.2
4 2010/03/31 08:45:18
meskes Exp $ */
statements: /*EMPTY*/
| statements statement
...
...
@@ -296,8 +296,13 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
for (ptr = cur; ptr != NULL; ptr = ptr->next)
{
if (strcmp($2, ptr->name) == 0)
{
/* re-definition is a bug */
mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
if ($2[0] == ':')
mmerror(PARSE_ERROR, ET_ERROR, "using variable \"%s\" in different declare statements is not supported", $2+1);
else
mmerror(PARSE_ERROR, ET_ERROR, "cursor \"%s\" is already defined", $2);
}
}
this = (struct cursor *) mm_alloc(sizeof(struct cursor));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment