apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r667330 - in /apr/apr-util/branches/1.3.x: dbd/apr_dbd.c dbd/apr_dbd_freetds.c include/apu.h.in
Date Fri, 13 Jun 2008 04:15:35 GMT
Author: bojan
Date: Thu Jun 12 21:15:34 2008
New Revision: 667330

URL: http://svn.apache.org/viewvc?rev=667330&view=rev
Log:
Backport 667328 from the trunk.
Make FreeTDS driver actually build.
Fix assorted warnings and errors in FreeTDS driver.

Modified:
    apr/apr-util/branches/1.3.x/dbd/apr_dbd.c
    apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c
    apr/apr-util/branches/1.3.x/include/apu.h.in

Modified: apr/apr-util/branches/1.3.x/dbd/apr_dbd.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/dbd/apr_dbd.c?rev=667330&r1=667329&r2=667330&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/dbd/apr_dbd.c (original)
+++ apr/apr-util/branches/1.3.x/dbd/apr_dbd.c Thu Jun 12 21:15:34 2008
@@ -125,6 +125,9 @@
 #if APU_HAVE_ORACLE
     DRIVER_LOAD("oracle", apr_dbd_oracle_driver, pool);
 #endif
+#if APU_HAVE_FREETDS
+    DRIVER_LOAD("freetds", apr_dbd_freetds_driver, pool);
+#endif
 #if APU_HAVE_SOME_OTHER_BACKEND
     DRIVER_LOAD("firebird", apr_dbd_other_driver, pool);
 #endif

Modified: apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c?rev=667330&r1=667329&r2=667330&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c (original)
+++ apr/apr-util/branches/1.3.x/dbd/apr_dbd_freetds.c Thu Jun 12 21:15:34 2008
@@ -124,7 +124,6 @@
                               const char *query, int seek)
 {
     apr_dbd_results_t *res;
-    int i;
     if (sql->trans && (sql->trans->errnum != SUCCEED)) {
         return 1;
     }
@@ -237,9 +236,10 @@
 static int dbd_freetds_pselect(apr_pool_t *pool, apr_dbd_t *sql,
                                apr_dbd_results_t **results,
                                apr_dbd_prepared_t *statement,
-                               int seek, int nargs, const char **values)
+                               int seek, const char **values)
 {
-    const char *query = dbd_statement(pool, statement, nargs, values);
+    const char *query = dbd_statement(pool, statement,
+                                      statement->nargs, values);
     return dbd_freetds_select(pool, sql, results, query, seek);
 }
 static int dbd_freetds_pvselect(apr_pool_t *pool, apr_dbd_t *sql,
@@ -260,15 +260,15 @@
         values[i] = va_arg(args, const char*);
     }
 
-    return dbd_freetds_pselect(pool, sql, results, statement, seek,
-                               statement->nargs, values);
+    return dbd_freetds_pselect(pool, sql, results, statement, seek, values);
 }
 static int dbd_freetds_query(apr_dbd_t *sql, int *nrows, const char *query);
 static int dbd_freetds_pquery(apr_pool_t *pool, apr_dbd_t *sql,
                               int *nrows, apr_dbd_prepared_t *statement,
-                              int nargs, const char **values)
+                              const char **values)
 {
-    const char *query = dbd_statement(pool, statement, nargs, values);
+    const char *query = dbd_statement(pool, statement,
+                                      statement->nargs, values);
     return dbd_freetds_query(sql, nrows, query);
 }
 static int dbd_freetds_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
@@ -286,8 +286,7 @@
     for (i = 0; i < statement->nargs; i++) {
         values[i] = va_arg(args, const char*);
     }
-    return dbd_freetds_pquery(pool, sql, nrows, statement,
-                              statement->nargs, values);
+    return dbd_freetds_pquery(pool, sql, nrows, statement, values);
 }
 
 static int dbd_freetds_get_row(apr_pool_t *pool, apr_dbd_results_t *res,
@@ -344,10 +343,10 @@
     int t = dbcoltype(proc, n+1);
     int l = dbcollen(proc, n+1);
     if (dbwillconvert(t, SYBCHAR)) {
-      dbconvert(proc, t, ptr, l, SYBCHAR, row->buf, -1);
+      dbconvert(proc, t, ptr, l, SYBCHAR, (BYTE *)row->buf, -1);
       return (const char*)row->buf;
     }
-    return ptr;
+    return (char*)ptr;
 }
 
 static const char *dbd_freetds_error(apr_dbd_t *sql, int n)
@@ -442,6 +441,7 @@
 
 static int dbd_freetds_prepare(apr_pool_t *pool, apr_dbd_t *sql,
                              const char *query, const char *label,
+                             int nargs, int nvals, apr_dbd_type_e *types,
                              apr_dbd_prepared_t **statement)
 {
     apr_dbd_prepared_t *stmt;
@@ -642,7 +642,7 @@
     if (dbdead(handle->proc)) {
         /* try again */
         dbclose(handle->proc);
-        handle->proc = freetds_open(handle->pool, handle->params);
+        handle->proc = freetds_open(handle->pool, handle->params, NULL);
         if (!handle->proc || dbdead(handle->proc)) {
             return APR_EGENERAL;
         }

Modified: apr/apr-util/branches/1.3.x/include/apu.h.in
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/include/apu.h.in?rev=667330&r1=667329&r2=667330&view=diff
==============================================================================
--- apr/apr-util/branches/1.3.x/include/apu.h.in (original)
+++ apr/apr-util/branches/1.3.x/include/apu.h.in Thu Jun 12 21:15:34 2008
@@ -99,6 +99,7 @@
 #define APU_HAVE_SQLITE3       @apu_have_sqlite3@
 #define APU_HAVE_SQLITE2       @apu_have_sqlite2@
 #define APU_HAVE_ORACLE        @apu_have_oracle@
+#define APU_HAVE_FREETDS       @apu_have_freetds@
 
 #define APU_HAVE_APR_ICONV     @have_apr_iconv@
 #define APU_HAVE_ICONV         @have_iconv@



Mime
View raw message