fix
[oweals/gnunet.git] / src / datastore / plugin_datastore_sqlite.c
index 45fd05e6fde107952871239333dbb7600517deb2..ca1f4e4ae607fda43ee135eb2130483ca79ea41e 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -29,7 +29,7 @@
 #include "plugin_datastore.h"
 #include <sqlite3.h>
 
-#define DEBUG_SQLITE GNUNET_YES
+#define DEBUG_SQLITE GNUNET_NO
 
 /**
  * After how many payload-changing operations
@@ -756,7 +756,7 @@ sqlite_plugin_put (void *cls,
       (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) ||
       (SQLITE_OK != sqlite3_bind_int (stmt, 3, priority)) ||
       (SQLITE_OK != sqlite3_bind_int (stmt, 4, anonymity)) ||
-      (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, (sqlite3_int64) expiration.value)) ||
+      (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, expiration.value)) ||
       (SQLITE_OK !=
        sqlite3_bind_blob (stmt, 6, key, sizeof (GNUNET_HashCode),
                           SQLITE_TRANSIENT)) ||
@@ -1616,8 +1616,9 @@ process_stat_done (void *cls,
   uint64_t page_size;
 
   plugin->stat_get = NULL;
-  if (plugin->stats_worked == GNUNET_NO)
-    {
+  if ( (plugin->stats_worked == GNUNET_NO) &&
+       (SQLITE_VERSION_NUMBER >= 3006000) )
+   {
       CHECK (SQLITE_OK ==
             sqlite3_exec (plugin->dbh,
                           "VACUUM", NULL, NULL, ENULL));