The libpq function PQfnumber does not handle case-insensitive
authorBruce Momjian
Wed, 3 Feb 1999 20:19:10 +0000 (20:19 +0000)
committerBruce Momjian
Wed, 3 Feb 1999 20:19:10 +0000 (20:19 +0000)
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

src/interfaces/libpq/fe-exec.c

index 4e9b1530d37b8985fbf5de42a5c6b3d6b7876c9f..e1d71bac4881a39fd207137d6162ca37fd0f1c5d 100644 (file)
@@ -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;