summaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_sqlite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/plugin_datastore_sqlite.c')
-rw-r--r--src/datastore/plugin_datastore_sqlite.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index cecc37978..f58955b7b 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -1258,14 +1258,35 @@ sqlite_plugin_estimate_size (void *cls, unsigned long long *estimate)
NULL,
NULL,
ENULL));
- CHECK (SQLITE_OK == sq_prepare (plugin->dbh, "PRAGMA page_count", &stmt));
+ if (SQLITE_OK != sq_prepare (plugin->dbh, "PRAGMA page_count", &stmt))
+ {
+ GNUNET_log_from (
+ GNUNET_ERROR_TYPE_WARNING,
+ "datastore-sqlite",
+ _("error preparing statement\n"));
+ return;
+ }
if (SQLITE_ROW == sqlite3_step (stmt))
pages = sqlite3_column_int64 (stmt, 0);
else
pages = 0;
sqlite3_finalize (stmt);
- CHECK (SQLITE_OK == sq_prepare (plugin->dbh, "PRAGMA page_size", &stmt));
- CHECK (SQLITE_ROW == sqlite3_step (stmt));
+ if (SQLITE_OK != sq_prepare (plugin->dbh, "PRAGMA page_size", &stmt))
+ {
+ GNUNET_log_from (
+ GNUNET_ERROR_TYPE_WARNING,
+ "datastore-sqlite",
+ _("error preparing statement\n"));
+ return;
+ }
+ if (SQLITE_ROW != sqlite3_step (stmt))
+ {
+ GNUNET_log_from (
+ GNUNET_ERROR_TYPE_WARNING,
+ "datastore-sqlite",
+ _("error stepping\n"));
+ return;
+ }
page_size = sqlite3_column_int64 (stmt, 0);
sqlite3_finalize (stmt);
GNUNET_log (