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:02:13 +0100 |
commit | 51867a0f9b5c6d15c541e19c202520e95c5950a0 (patch) | |
tree | 14fc70d4b16f82c636da7b13ffd4ee0b81fe0d1f /src | |
parent | d1b88f6b3660753771895a4441b6bb4ccc9bcaac (diff) | |
download | postgresql-51867a0f9b5c6d15c541e19c202520e95c5950a0.tar.gz postgresql-51867a0f9b5c6d15c541e19c202520e95c5950a0.zip |
ECPG: Fix searching for quoted cursor names case-sensitively.
Patch by Böszörményi Zoltán <zb@cybertec.at>
Diffstat (limited to 'src')
-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 0682287c765..b3b36cf72da 100644 --- a/src/interfaces/ecpg/preproc/ecpg.addons +++ b/src/interfaces/ecpg/preproc/ecpg.addons @@ -290,7 +290,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 71b11f41e0d..64e7600a8cb 100644 --- a/src/interfaces/ecpg/preproc/ecpg.header +++ b/src/interfaces/ecpg/preproc/ecpg.header @@ -492,7 +492,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 173fd08587c..3b6d1e51924 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; |