aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2013-11-27 11:02:13 +0100
committerMichael Meskes <meskes@postgresql.org>2013-11-27 11:15:34 +0100
commit9a1c6dd43a119b11a1a5114a99deec9d93fd21b7 (patch)
treef3928bf460a26cdec39314e668683335b078ee85 /src
parenta1726994bfd72cedc2808191139dea0d7f77f9f8 (diff)
downloadpostgresql-9a1c6dd43a119b11a1a5114a99deec9d93fd21b7.tar.gz
postgresql-9a1c6dd43a119b11a1a5114a99deec9d93fd21b7.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.addons2
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.header2
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.trailer2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 9f016861156..4753c1ed6f5 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 1710ef55d79..80c90feb6a6 100644
--- a/src/interfaces/ecpg/preproc/ecpg.header
+++ b/src/interfaces/ecpg/preproc/ecpg.header
@@ -377,7 +377,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 6d126f7300e..37e8dbb7eb9 100644
--- a/src/interfaces/ecpg/preproc/ecpg.trailer
+++ b/src/interfaces/ecpg/preproc/ecpg.trailer
@@ -289,7 +289,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;