From dev-return-20489-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Fri Jun 13 08:34:33 2008 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 51633 invoked from network); 13 Jun 2008 08:34:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2008 08:34:33 -0000 Received: (qmail 88405 invoked by uid 500); 13 Jun 2008 08:34:34 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 88356 invoked by uid 500); 13 Jun 2008 08:34:34 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 88345 invoked by uid 99); 13 Jun 2008 08:34:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jun 2008 01:34:34 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.202.165.221] (HELO smtpout05.prod.mesa1.secureserver.net) (64.202.165.221) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 13 Jun 2008 08:33:44 +0000 Received: (qmail 13220 invoked from network); 13 Jun 2008 08:33:52 -0000 Received: from unknown (71.239.140.137) by smtpout05-04.prod.mesa1.secureserver.net (64.202.165.221) with ESMTP; 13 Jun 2008 08:33:51 -0000 Message-ID: <485230D6.604@rowe-clan.net> Date: Fri, 13 Jun 2008 03:33:26 -0500 From: "William A. Rowe, Jr." User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: svn commit: r667418 - in /apr/apr-util/trunk/dbd: apr_dbd_oracle.c apr_dbd_pgsql.c apr_dbd_sqlite3.c References: <20080613083159.895342388A15@eris.apache.org> In-Reply-To: <20080613083159.895342388A15@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org If someone on unix with all three providers can confirm this is clean, I'm happy to backport. Bill wrowe@apache.org wrote: > Author: wrowe > Date: Fri Jun 13 01:31:58 2008 > New Revision: 667418 > > URL: http://svn.apache.org/viewvc?rev=667418&view=rev > Log: > Signedness fixes, const'ness fix (OCIAttrGet is not > happy with a const arg) and note especially atof() > generally returns a double, which was seen as truncation. > > Modified: > apr/apr-util/trunk/dbd/apr_dbd_oracle.c > apr/apr-util/trunk/dbd/apr_dbd_pgsql.c > apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c > > Modified: apr/apr-util/trunk/dbd/apr_dbd_oracle.c > URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_oracle.c?rev=667418&r1=667417&r2=667418&view=diff > ============================================================================== > --- apr/apr-util/trunk/dbd/apr_dbd_oracle.c (original) > +++ apr/apr-util/trunk/dbd/apr_dbd_oracle.c Fri Jun 13 01:31:58 2008 > @@ -262,7 +262,7 @@ > /* fetch from offset if not at the beginning */ > buf = apr_palloc(row->pool, APR_BUCKET_BUFF_SIZE); > sql->status = OCILobRead(sql->svc, sql->err, val->buf.lobval, > - &length, 1 + boffset, > + &length, 1 + (size_t)boffset, > (dvoid*) buf, APR_BUCKET_BUFF_SIZE, > NULL, NULL, 0, SQLCS_IMPLICIT); > /* Only with 10g, unfortunately > @@ -995,7 +995,7 @@ > int i; > ub2 paramtype[DBD_ORACLE_MAX_COLUMNS]; > ub2 paramsize[DBD_ORACLE_MAX_COLUMNS]; > - const char *paramname[DBD_ORACLE_MAX_COLUMNS]; > + char *paramname[DBD_ORACLE_MAX_COLUMNS]; > ub4 paramnamelen[DBD_ORACLE_MAX_COLUMNS]; > int_errorcode; > > @@ -2018,7 +2018,7 @@ > if (entry == NULL) { > return APR_ENOENT; > } > - *(float*)data = atof(entry); > + *(float*)data = (float)atof(entry); > break; > case APR_DBD_TYPE_DOUBLE: > entry = dbd_oracle_get_entry(row, n); > > Modified: apr/apr-util/trunk/dbd/apr_dbd_pgsql.c > URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c?rev=667418&r1=667417&r2=667418&view=diff > ============================================================================== > --- apr/apr-util/trunk/dbd/apr_dbd_pgsql.c (original) > +++ apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Fri Jun 13 01:31:58 2008 > @@ -258,7 +258,7 @@ > } > > if (res->random) { > - if (row->n >= res->ntuples) { > + if ((row->n > 0) && (size_t)row->n >= res->ntuples) { > *rowp = NULL; > apr_pool_cleanup_run(pool, res->res, clear_result); > res->res = NULL; > @@ -266,7 +266,7 @@ > } > } > else { > - if (row->n >= res->ntuples) { > + if ((row->n > 0) && (size_t)row->n >= res->ntuples) { > /* no data; we have to fetch some */ > row->n -= res->ntuples; > if (res->res != NULL) { > @@ -344,7 +344,7 @@ > *(apr_uint64_t*)data = apr_atoi64(PQgetvalue(row->res->res, row->n, n)); > break; > case APR_DBD_TYPE_FLOAT: > - *(float*)data = atof(PQgetvalue(row->res->res, row->n, n)); > + *(float*)data = (float)atof(PQgetvalue(row->res->res, row->n, n)); > break; > case APR_DBD_TYPE_DOUBLE: > *(double*)data = atof(PQgetvalue(row->res->res, row->n, n)); > @@ -477,7 +477,7 @@ > char *sqlcmd; > char *sqlptr; > size_t length, qlen; > - size_t i = 0; > + int i = 0; > const char **args; > size_t alen; > int ret; > > Modified: apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c > URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c?rev=667418&r1=667417&r2=667418&view=diff > ============================================================================== > --- apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c (original) > +++ apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c Fri Jun 13 01:31:58 2008 > @@ -86,8 +86,8 @@ > apr_dbd_results_t **results, > sqlite3_stmt *stmt, int seek) > { > - int i, ret, retry_count = 0, column_count; > - size_t num_tuples = 0; > + int ret, retry_count = 0, column_count; > + size_t i, num_tuples = 0; > int increment = 0; > apr_dbd_row_t *row = NULL; > apr_dbd_row_t *lastrow = NULL; > @@ -207,7 +207,7 @@ > > static const char *dbd_sqlite3_get_name(const apr_dbd_results_t *res, int n) > { > - if ((n < 0) || (n >= res->sz)) { > + if ((n < 0) || ((size_t)n >= res->sz)) { > return NULL; > } > > @@ -256,7 +256,7 @@ > static apr_status_t dbd_sqlite3_datum_get(const apr_dbd_row_t *row, int n, > apr_dbd_type_e type, void *data) > { > - if ((n < 0) || (n >= row->res->sz)) { > + if ((n < 0) || ((size_t)n >= row->res->sz)) { > return APR_EGENERAL; > } > > @@ -296,7 +296,7 @@ > *(apr_uint64_t*)data = apr_atoi64(row->columns[n]->value); > break; > case APR_DBD_TYPE_FLOAT: > - *(float*)data = atof(row->columns[n]->value); > + *(float*)data = (float)atof(row->columns[n]->value); > break; > case APR_DBD_TYPE_DOUBLE: > *(double*)data = atof(row->columns[n]->value); > > > >