diff options
author | Michael Meskes <meskes@postgresql.org> | 2009-11-27 16:07:22 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2009-11-27 16:07:22 +0000 |
commit | bb28e836361b24229bd6fea2ca76a905faea5702 (patch) | |
tree | d3c5db39fe4c86c65be93a4112ffada14996809a /src | |
parent | d7d5c6857b976c221e84ca8b461c7e8d14f0d994 (diff) | |
download | postgresql-bb28e836361b24229bd6fea2ca76a905faea5702.tar.gz postgresql-bb28e836361b24229bd6fea2ca76a905faea5702.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.addons | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons index 85bdb9cabce..3899fabf515 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.10 2009/11/26 15:39:26 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.11 2009/11/27 16:07:22 meskes Exp $ */ ECPG: stmtClosePortalStmt block { if (INFORMIX_MODE) @@ -297,7 +297,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt { struct cursor *ptr, *this; char *cursor_marker = $2[0] == ':' ? make_str("$0") : mm_strdup($2); - char *comment; + char *comment, *c1, *c2; for (ptr = cur; ptr != NULL; ptr = ptr->next) { @@ -317,7 +317,14 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt argsinsert = argsresult = NULL; cur = this; - comment = cat_str(3, make_str("/*"), mm_strdup(this->command), make_str("*/")); + 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] = '.'; + } + comment = cat_str(3, make_str("/*"), c1, make_str("*/")); if (INFORMIX_MODE) { |