diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datastore/plugin_datastore_sqlite.c | 27 |
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) | |||
1258 | NULL, | 1258 | NULL, |
1259 | NULL, | 1259 | NULL, |
1260 | ENULL)); | 1260 | ENULL)); |
1261 | CHECK (SQLITE_OK == sq_prepare (plugin->dbh, "PRAGMA page_count", &stmt)); | 1261 | if (SQLITE_OK != sq_prepare (plugin->dbh, "PRAGMA page_count", &stmt)) |
1262 | { | ||
1263 | GNUNET_log_from ( | ||
1264 | GNUNET_ERROR_TYPE_WARNING, | ||
1265 | "datastore-sqlite", | ||
1266 | _("error preparing statement\n")); | ||
1267 | return; | ||
1268 | } | ||
1262 | if (SQLITE_ROW == sqlite3_step (stmt)) | 1269 | if (SQLITE_ROW == sqlite3_step (stmt)) |
1263 | pages = sqlite3_column_int64 (stmt, 0); | 1270 | pages = sqlite3_column_int64 (stmt, 0); |
1264 | else | 1271 | else |
1265 | pages = 0; | 1272 | pages = 0; |
1266 | sqlite3_finalize (stmt); | 1273 | sqlite3_finalize (stmt); |
1267 | CHECK (SQLITE_OK == sq_prepare (plugin->dbh, "PRAGMA page_size", &stmt)); | 1274 | if (SQLITE_OK != sq_prepare (plugin->dbh, "PRAGMA page_size", &stmt)) |
1268 | CHECK (SQLITE_ROW == sqlite3_step (stmt)); | 1275 | { |
1276 | GNUNET_log_from ( | ||
1277 | GNUNET_ERROR_TYPE_WARNING, | ||
1278 | "datastore-sqlite", | ||
1279 | _("error preparing statement\n")); | ||
1280 | return; | ||
1281 | } | ||
1282 | if (SQLITE_ROW != sqlite3_step (stmt)) | ||
1283 | { | ||
1284 | GNUNET_log_from ( | ||
1285 | GNUNET_ERROR_TYPE_WARNING, | ||
1286 | "datastore-sqlite", | ||
1287 | _("error stepping\n")); | ||
1288 | return; | ||
1289 | } | ||
1269 | page_size = sqlite3_column_int64 (stmt, 0); | 1290 | page_size = sqlite3_column_int64 (stmt, 0); |
1270 | sqlite3_finalize (stmt); | 1291 | sqlite3_finalize (stmt); |
1271 | GNUNET_log ( | 1292 | GNUNET_log ( |