apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r731796 - in /apr/apr-util/branches/1.3.x: CHANGES dbd/apr_dbd_pgsql.c
Date Tue, 06 Jan 2009 00:50:14 GMT
Author: bojan
Date: Mon Jan  5 16:50:14 2009
New Revision: 731796

URL: http://svn.apache.org/viewvc?rev=731796&view=rev
Log:
Backport r704986 from the trunk.
Suppress pgsql column-out-of-range warning
PR 46012 - patch from Michiel van Loon.

Modified:
    apr/apr-util/branches/1.3.x/CHANGES
    apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c   (contents, props changed)

Modified: apr/apr-util/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/CHANGES?rev=731796&r1=731795&r2=731796&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.3.x/CHANGES [utf-8] Mon Jan  5 16:50:14 2009
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.3.5
 
+  *) Suppress pgsql column-out-of-range warning.
+     PR 46012 [Michiel van Loon <michiel van-loon.xs4all.nl>]
+
   *) Fix a buffer overrun and password matching for SHA passwords.
      PR 45679 [Ben Noordhuis <bnoordhuis gmail.com>]
 

Modified: apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c?rev=731796&r1=731795&r2=731796&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c (original)
+++ apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c Mon Jan  5 16:50:14 2009
@@ -218,7 +218,12 @@
 
 static const char *dbd_pgsql_get_name(const apr_dbd_results_t *res, int n)
 {
-    return (res->res ? PQfname(res->res, n) : NULL);
+    if (res->res) {
+        if ((n>=0) && (PQnfields(res->res) > n)) {
+            return PQfname(res->res,n);
+        }
+    }
+    return NULL;
 }
 
 static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res,

Propchange: apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Mon Jan  5 16:50:14 2009
@@ -0,0 +1,2 @@
+/apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c:692751
+/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c:692751,704986



Mime
View raw message