index 818ef540c2ce447bb8a98bd20dbe4cc276cf93d3..a6760d4b9137fa580f61b4376911c7fd5d2ea882 100644 (file)
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.18 2010年03月23日 22:12:06 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.19 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));
index 436c4fda4bdacba4ff0b0a3a5765189cbdcdcfae..d5e16afab60a28d83df01173f5e224cf763071bd 100644 (file)
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.23 2010年03月21日 11:56:45 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.24 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));