Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
e01c6ce7
Commit
e01c6ce7
authored
15 years ago
by
Michael Meskes
Browse files
Options
Downloads
Patches
Plain Diff
Give a more precise error message if a variable is re-used as cursor name in ecpg.
parent
d174a4ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/interfaces/ecpg/preproc/ecpg.addons
+7
-2
7 additions, 2 deletions
src/interfaces/ecpg/preproc/ecpg.addons
src/interfaces/ecpg/preproc/ecpg.trailer
+7
-2
7 additions, 2 deletions
src/interfaces/ecpg/preproc/ecpg.trailer
with
14 additions
and
4 deletions
src/interfaces/ecpg/preproc/ecpg.addons
+
7
−
2
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
ECPG: stmtClosePortalStmt block
{
{
if (INFORMIX_MODE)
if (INFORMIX_MODE)
...
@@ -306,7 +306,12 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
...
@@ -306,7 +306,12 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
for (ptr = cur; ptr != NULL; ptr = ptr->next)
for (ptr = cur; ptr != NULL; ptr = ptr->next)
{
{
if (strcmp($2, ptr->name) == 0)
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));
this = (struct cursor *) mm_alloc(sizeof(struct cursor));
...
...
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/preproc/ecpg.trailer
+
7
−
2
View file @
e01c6ce7
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.2
3
2010/03/
2
1
11:56:45
meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.2
4
2010/03/
3
1
08:45:18
meskes Exp $ */
statements: /*EMPTY*/
statements: /*EMPTY*/
| statements statement
| statements statement
...
@@ -296,8 +296,13 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
...
@@ -296,8 +296,13 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
for (ptr = cur; ptr != NULL; ptr = ptr->next)
for (ptr = cur; ptr != NULL; ptr = ptr->next)
{
{
if (strcmp($2, ptr->name) == 0)
if (strcmp($2, ptr->name) == 0)
{
/* re-definition is a bug */
/* 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));
this = (struct cursor *) mm_alloc(sizeof(struct cursor));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment