Hi Paul,

I've attached a patch to the SQLite 3 driver that
fixes some initialization issues and returns float
data. This has been tested with the jxta-c.jxta.org
project and no major issues. If we could get it in the
release that would be great! We are relying on this
patch to be part of the release.

Rick Keiner

--- Paul Querna <[EMAIL PROTECTED]> wrote:

> APR-Util 1.2.1 is now available from:
> http://people.apache.org/~pquerna/dev/apu-1.2.1/
> 
> Please test and vote on releasing it.
> 
> Thanks,
> 
> Paul
> 
Index: dbd/apr_dbd_sqlite3.c
===================================================================
--- dbd/apr_dbd_sqlite3.c	(revision 232397)
+++ dbd/apr_dbd_sqlite3.c	(working copy)
@@ -117,6 +117,7 @@
                 } else {
                     apr_thread_mutex_unlock(sql->mutex);
                     apr_sleep(MAX_RETRY_SLEEP);
+                    apr_thread_mutex_lock(sql->mutex);
                 }
             } else if (ret == SQLITE_ROW) {
                 int length;
@@ -135,22 +136,20 @@
                     column->size = sqlite3_column_bytes((*results)->stmt, i);
                     column->type = sqlite3_column_type((*results)->stmt, i);
                     switch (column->type) {
-
-                    case SQLITE_FLOAT:
-                        break;
-                    case SQLITE_INTEGER:
-                    case SQLITE_TEXT:
-                        hold = NULL;
-                        hold = (char *) sqlite3_column_text((*results)->stmt, i);
-                        if (hold) {
-                            column->value = apr_palloc(pool, column->size + 1);
-                            strncpy(column->value, hold, column->size + 1);
-                        }
-                        break;
-                    case SQLITE_BLOB:
-                        break;
-                    case SQLITE_NULL:
-                        break;
+                        case SQLITE_FLOAT:
+                        case SQLITE_INTEGER:
+                        case SQLITE_TEXT:
+                            hold = NULL;
+                            hold = (char *) sqlite3_column_text((*results)->stmt, i);
+                            if (hold) {
+                                column->value = apr_palloc(pool, column->size + 1);
+                                strncpy(column->value, hold, column->size + 1);
+                            }
+                            break;
+                        case SQLITE_BLOB:
+                            break;
+                        case SQLITE_NULL:
+                            break;
                     }
                     col = row->columns[i];
                 }
@@ -226,19 +225,13 @@
 {
     sqlite3_stmt *stmt = NULL;
     const char *tail = NULL;
-    int ret, length = 0;
+    int ret = 0, retry_count = 0, length = 0;
     apr_status_t res;
-    apr_pool_t *pool;
 
     if (sql->trans && sql->trans->errnum) {
         return sql->trans->errnum;
     }
 
-    res = apr_pool_create(&pool, sql->pool);
-    if (res != APR_SUCCESS) {
-        sql->trans->errnum = res;
-        return SQLITE_ERROR;
-    }
     length = strlen(query);
     apr_thread_mutex_lock(sql->mutex);
 
@@ -248,7 +241,6 @@
             sqlite3_finalize(stmt);
             break;
         }
-
         ret = sqlite3_step(stmt);
         *nrows = sqlite3_changes(sql->conn);
         sqlite3_finalize(stmt);
@@ -260,7 +252,6 @@
         res = 0;
     }
     apr_thread_mutex_unlock(sql->mutex);
-    apr_pool_destroy(pool);
     if (sql->trans) {
         sql->trans->errnum = res;
     }

Reply via email to