You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bo...@apache.org on 2009/02/25 01:50:26 UTC

svn commit: r747632 - in /apr/apr-util/branches/1.3.x: ./ dbd/apr_dbd_odbc.c dbd/apr_dbd_pgsql.c

Author: bojan
Date: Wed Feb 25 00:50:25 2009
New Revision: 747632

URL: http://svn.apache.org/viewvc?rev=747632&view=rev
Log:
Backport r747630 from the trunk.
Clean up ODBC types. Warnings seen when compiling packages for Fedora 11.

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

Propchange: apr/apr-util/branches/1.3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 25 00:50:25 2009
@@ -1,2 +1,2 @@
 /apr/apr-util/branches/1.3.x:692751
-/apr/apr-util/trunk:692751,731225,743986,744009,745771,747612,747623
+/apr/apr-util/trunk:692751,731225,743986,744009,745771,747612,747623,747630

Modified: apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c?rev=747632&r1=747631&r2=747632&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c (original)
+++ apr/apr-util/branches/1.3.x/dbd/apr_dbd_odbc.c Wed Feb 25 00:50:25 2009
@@ -500,9 +500,9 @@
     SQLRETURN rc;
     SQLSMALLINT baseType, cType;
     void *ptr;
-    SQLUINTEGER len;
-    SQLINTEGER *indicator;
-    static SQLINTEGER nullValue = SQL_NULL_DATA;
+    SQLULEN len;
+    SQLLEN *indicator;
+    static SQLLEN nullValue = SQL_NULL_DATA;
     static SQLSMALLINT inOut = SQL_PARAM_INPUT;     /* only input params */
 
     /* bind a NULL data value */
@@ -522,7 +522,7 @@
         /* LOBs */
         if (IS_LOB(cType)) {
             ptr = (void *) args[*argp];
-            len = (SQLUINTEGER) * (apr_size_t *) args[*argp + 1];
+            len = (SQLULEN) * (apr_size_t *) args[*argp + 1];
             cType = (IS_CLOB(cType)) ? SQL_C_CHAR : SQL_C_DEFAULT;
             (*argp) += 4;  /* LOBs consume 4 args (last two are unused) */
         }
@@ -534,7 +534,7 @@
             case SQL_TIME:
             case SQL_TIMESTAMP:
                 ptr = (void *) args[*argp];
-                len = (SQLUINTEGER) strlen(ptr);
+                len = (SQLULEN) strlen(ptr);
                 break;
             case SQL_TINYINT:
                 ptr = apr_palloc(pool, sizeof(unsigned char));
@@ -619,7 +619,7 @@
                                          apr_size_t *len, apr_read_type_e block)
 {
     SQLRETURN rc;
-    SQLINTEGER len_indicator;
+    SQLLEN len_indicator;
     SQLSMALLINT type;
     odbc_bucket *bd = (odbc_bucket *) e->data;
     apr_bucket *nxt;
@@ -666,8 +666,8 @@
              * We try to handle both interpretations.
              */
             *len =  (len_indicator > bufsize 
-                     && len_indicator >= (SQLINTEGER) e->start)
-                ? (len_indicator - (SQLINTEGER) e->start) : len_indicator;
+                     && len_indicator >= (SQLLEN) e->start)
+                ? (len_indicator - (SQLLEN) e->start) : len_indicator;
 
             eos = 1;
         }
@@ -731,7 +731,7 @@
                       const SQLSMALLINT sqltype)
 {
     SQLRETURN rc;
-    SQLINTEGER indicator;
+    SQLLEN indicator;
     int state = row->res->colstate[col];
     int options = row->res->apr_dbd->dboptions;
 
@@ -1029,7 +1029,7 @@
             err_step="SQLSetConnectAttr (from DBD Parameters)";
             err_htype = SQL_HANDLE_DBC;
             err_h = hdbc;
-            rc = SQLSetConnectAttr(hdbc, attrs[i], (void *) attrvals[i], 0);
+            rc = SQLSetConnectAttr(hdbc, attrs[i], (SQLPOINTER) attrvals[i], 0);
         }
     }
     if (SQL_SUCCEEDED(rc)) {
@@ -1120,8 +1120,8 @@
     SQLRETURN rc = SQL_SUCCESS;
 
     if (handle->transaction_mode) {
-        rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_TXN_ISOLATION, (void *)
-                               handle->transaction_mode, 0);
+        rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_TXN_ISOLATION,
+                               (SQLPOINTER) handle->transaction_mode, 0);
         CHECK_ERROR(handle, "SQLSetConnectAttr (SQL_ATTR_TXN_ISOLATION)", rc,
                     SQL_HANDLE_DBC, handle->dbc);
     }
@@ -1181,7 +1181,10 @@
     CHECK_ERROR(handle, "SQLExecDirect", rc, SQL_HANDLE_STMT, hstmt);
 
     if SQL_SUCCEEDED(rc) {
-        rc = SQLRowCount(hstmt,  (SQLINTEGER *) nrows);
+        SQLLEN rowcount;
+
+        rc = SQLRowCount(hstmt, &rowcount);
+        *nrows = (int) rowcount;
         CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, hstmt);
     }
 
@@ -1243,7 +1246,7 @@
 static int odbc_num_tuples(apr_dbd_results_t *res)
 {
     SQLRETURN rc;
-    SQLINTEGER  nrows;
+    SQLLEN nrows;
 
     rc = SQLRowCount(res->stmt, &nrows);
     CHECK_ERROR(res->apr_dbd, "SQLRowCount", rc, SQL_HANDLE_STMT, res->stmt);
@@ -1426,7 +1429,10 @@
                     statement->stmt);
         }
     if (SQL_SUCCEEDED(rc)) {
-        rc = SQLRowCount(statement->stmt, (SQLINTEGER *) nrows);
+        SQLLEN rowcount;
+
+        rc = SQLRowCount(statement->stmt, &rowcount);
+        *nrows = (int) rowcount;
         CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT,
                     statement->stmt);
         }
@@ -1501,7 +1507,7 @@
     SQLRETURN rc;
     char buffer[MAX_COLUMN_NAME];
     SQLSMALLINT colnamelength, coltype, coldecimal, colnullable;
-    SQLUINTEGER colsize;
+    SQLULEN colsize;
 
     if (col >= res->ncols)
         return NULL;            /* bogus column number */
@@ -1556,7 +1562,10 @@
                     statement->stmt);
         }
     if (SQL_SUCCEEDED(rc)) {
-        rc = SQLRowCount(statement->stmt, (SQLINTEGER *) nrows);
+        SQLLEN rowcount;
+
+        rc = SQLRowCount(statement->stmt, &rowcount);
+        *nrows = (int) rowcount;
         CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT,
                     statement->stmt);
         }

Propchange: apr/apr-util/branches/1.3.x/dbd/apr_dbd_pgsql.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 25 00:50:25 2009
@@ -1,2 +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,731225,743986,744009,745771,747612,747623
+/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c:692751,704986,731225,743986,744009,745771,747612,747623,747630