From: Bruce Momjian Date: Wed, 3 Feb 1999 20:19:10 +0000 (+0000) Subject: The libpq function PQfnumber does not handle case-insensitive X-Git-Tag: REL6_5~727 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3982368a4e2ae08659c1bd7536c91ec9c08a6139;p=thirdparty%2Fpostgresql.git The libpq function PQfnumber does not handle case-insensitive comparisons correctly. The psql monitor converts all table and field names to lower case. If the PQfnumber function is called with a mixed case name, it will always return -1. Bahman Rafatjoo --- diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 4e9b1530d37..e1d71bac488 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.71 1998/11/29 01:53:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.72 1999/02/03 20:19:10 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1650,7 +1650,7 @@ PQfnumber(PGresult *res, const char *field_name) for (i = 0; i < res->numAttributes; i++) { - if (strcmp(field_name, res->attDescs[i].name) == 0) + if (strcmp(field_case, res->attDescs[i].name) == 0) { free(field_case); return i;