提交 3982368a 编写于 作者: B Bruce Momjian

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
上级 8d9237d4
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -1650,7 +1650,7 @@ PQfnumber(PGresult *res, const char *field_name)
for (i = 0; i < res->numAttributes; i++) 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); free(field_case);
return i; return i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册