summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/ecpg.trailer
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2010-09-10 10:13:20 +0000
committerMichael Meskes <meskes@postgresql.org>2010-09-10 10:13:20 +0000
commit81624db39aa7501690aab71a68af689df78b71e8 (patch)
tree524bdba2efaf7d214efad6e899327ad15e3d15bf /src/interfaces/ecpg/preproc/ecpg.trailer
parent0b81c7c4174ef97b10be58f29016af23549c6c12 (diff)
downloadpostgresql-81624db39aa7501690aab71a68af689df78b71e8.tar.gz
Cursor names in the backend are not case-sensitve. This change makes sure that
ecpg also does not regard cursor names as case-sensitive. Thanks to Zoltan Boszormenyi for the patch.
Diffstat (limited to 'src/interfaces/ecpg/preproc/ecpg.trailer')
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.trailer5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer
index 59fc26c0dd..2b99b4e4cf 100644
--- a/src/interfaces/ecpg/preproc/ecpg.trailer
+++ b/src/interfaces/ecpg/preproc/ecpg.trailer
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.26 2010/05/25 17:28:20 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.27 2010/09/10 10:13:20 meskes Exp $ */
statements: /*EMPTY*/
| statements statement
@@ -289,13 +289,14 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
{
struct cursor *ptr, *this;
char *cursor_marker = $2[0] == ':' ? make_str("$0") : mm_strdup($2);
+ int (* strcmp_fn)(const char *, const char *) = ($2[0] == ':' ? strcmp : pg_strcasecmp);
struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
const char *con = connection ? connection : "NULL";
char *comment;
for (ptr = cur; ptr != NULL; ptr = ptr->next)
{
- if (strcmp($2, ptr->name) == 0)
+ if (strcmp_fn($2, ptr->name) == 0)
{
/* re-definition is a bug */
if ($2[0] == ':')