Skip to content

Commit 9a1c6dd

Browse files
author
Michael Meskes
committed
ECPG: Fix searching for quoted cursor names case-sensitively.
Patch by Böszörményi Zoltán <zb@cybertec.at>
1 parent a172699 commit 9a1c6dd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/interfaces/ecpg/preproc/ecpg.addons

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
296296
struct cursor *ptr, *this;
297297
char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
298298
char *comment, *c1, *c2;
299-
int (* strcmp_fn)(const char *, const char *) = ($2[0] == ':' ? strcmp : pg_strcasecmp);
299+
int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp);
300300

301301
for (ptr = cur; ptr != NULL; ptr = ptr->next)
302302
{

src/interfaces/ecpg/preproc/ecpg.header

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ add_additional_variables(char *name, bool insert)
377377
{
378378
struct cursor *ptr;
379379
struct arguments *p;
380-
int (* strcmp_fn)(const char *, const char *) = (name[0] == ':' ? strcmp : pg_strcasecmp);
380+
int (* strcmp_fn)(const char *, const char *) = ((name[0] == ':' || name[0] == '"') ? strcmp : pg_strcasecmp);
381381

382382
for (ptr = cur; ptr != NULL; ptr=ptr->next)
383383
{

src/interfaces/ecpg/preproc/ecpg.trailer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
289289
{
290290
struct cursor *ptr, *this;
291291
char *cursor_marker = $2[0] == ':' ? mm_strdup("$0") : mm_strdup($2);
292-
int (* strcmp_fn)(const char *, const char *) = ($2[0] == ':' ? strcmp : pg_strcasecmp);
292+
int (* strcmp_fn)(const char *, const char *) = (($2[0] == ':' || $2[0] == '"') ? strcmp : pg_strcasecmp);
293293
struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
294294
const char *con = connection ? connection : "NULL";
295295
char *comment;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy