Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3982368

Browse files
committed
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
1 parent 8d9237d commit 3982368

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/interfaces/libpq/fe-exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.71 1998/11/29 01:53:54 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.72 1999/02/03 20:19:10 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1650,7 +1650,7 @@ PQfnumber(PGresult *res, const char *field_name)
16501650

16511651
for (i = 0; i < res->numAttributes; i++)
16521652
{
1653-
if (strcmp(field_name, res->attDescs[i].name) == 0)
1653+
if (strcmp(field_case, res->attDescs[i].name) == 0)
16541654
{
16551655
free(field_case);
16561656
return i;

0 commit comments

Comments
 (0)