aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2009-11-27 16:11:50 +0000
committerMichael Meskes <meskes@postgresql.org>2009-11-27 16:11:50 +0000
commit2164a24686bf7d6b10a9f9a9952954c76bc4bfa1 (patch)
tree074ef98769ed0f2c357edffb164620fae07f47a5 /src
parent7c605d5dfa8033a7d1394af8e61cde0d23fe6661 (diff)
downloadpostgresql-2164a24686bf7d6b10a9f9a9952954c76bc4bfa1.tar.gz
postgresql-2164a24686bf7d6b10a9f9a9952954c76bc4bfa1.zip
Remove */ characters from declare cursor statements before putting them into a
comment.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.addons15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index d864dfbdf7a..757200c410c 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.4 2009/01/30 12:53:43 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.4.2.1 2009/11/27 16:11:50 meskes Exp $ */
ECPG: stmtClosePortalStmt block
{
@@ -238,6 +238,7 @@ ECPG: ExecuteStmtEXECUTEprepared_nameexecute_param_clauseexecute_rest block
ECPG: DeclareCursorStmtDECLAREnamecursor_optionsCURSORopt_holdFORSelectStmt block
{
struct cursor *ptr, *this;
+ char *c1, *c2;
for (ptr = cur; ptr != NULL; ptr = ptr->next)
{
@@ -257,10 +258,18 @@ ECPG: DeclareCursorStmtDECLAREnamecursor_optionsCURSORopt_holdFORSelectStmt bloc
argsinsert = argsresult = NULL;
cur = this;
+ c1 = mm_strdup(this->command);
+ if ((c2 = strstr(c1, "*/")) != NULL)
+ {
+ /* We put this text into a comment, so we better remove [*][/]. */
+ c2[0] = '.';
+ c2[1] = '.';
+ }
+
if (INFORMIX_MODE)
- $$ = cat_str(5, adjust_informix(this->argsinsert), adjust_informix(this->argsresult), make_str("/*"), mm_strdup(this->command), make_str("*/"));
+ $$ = cat_str(5, adjust_informix(this->argsinsert), adjust_informix(this->argsresult), make_str("/*"), c1, make_str("*/"));
else
- $$ = cat_str(3, make_str("/*"), mm_strdup(this->command), make_str("*/"));
+ $$ = cat_str(3, make_str("/*"), c1, make_str("*/"));
}
ECPG: opt_hold block
{