diff options
author | Michael Meskes <meskes@postgresql.org> | 2013-11-27 11:02:13 +0100 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2013-11-27 11:15:13 +0100 |
commit | 0cedfa766d5e467a1f9848adac829a0d36d6f510 (patch) | |
tree | 5c4fb15c06a8d6239a4c56c50133555b3e9cd160 | |
parent | 6bb2972c094032edc88e7c4fc518afe1e7b5d579 (diff) |
ECPG: Fix searching for quoted cursor names case-sensitively.
Patch by Böszörményi Zoltán <zb@cybertec.at>
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.addons | 2 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.header | 2 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.trailer | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons index 5c5adf76996..5559863ff6b 100644 --- a/src/interfaces/ecpg/preproc/ecpg.addons +++ b/src/interfaces/ecpg/preproc/ecpg.addons @@ -296,7 +296,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt struct cursor *ptr, *this; char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2); char *comment, *c1, *c2; - int (* strcmp_fn)(const char *, const char *) = ($2[0] == ':' ? strcmp : pg_strcasecmp); + int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp); for (ptr = cur; ptr != NULL; ptr = ptr->next) { diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header index 88d9cf53c0c..75538e3bd96 100644 --- a/src/interfaces/ecpg/preproc/ecpg.header +++ b/src/interfaces/ecpg/preproc/ecpg.header @@ -477,7 +477,7 @@ add_additional_variables(char *name, bool insert) { struct cursor *ptr; struct arguments *p; - int (* strcmp_fn)(const char *, const char *) = (name[0] == ':' ? strcmp : pg_strcasecmp); + int (* strcmp_fn)(const char *, const char *) = ((name[0] == ':' || name[0] == '"') ? strcmp : pg_strcasecmp); for (ptr = cur; ptr != NULL; ptr=ptr->next) { diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index 43b954f0457..70dc690a5bc 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -291,7 +291,7 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared { struct cursor *ptr, *this; char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2); - int (* strcmp_fn)(const char *, const char *) = ($2[0] == ':' ? strcmp : pg_strcasecmp); + int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp); struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable)); const char *con = connection ? connection : "NULL"; char *comment; |