Turn off secure_delete in sqlite

libsqlite3 that ships with some distributions may have secure_delete
activated by default. This means all database records are overwritten
with zeros on DELETE. We don't needs this extra overhead.

Change-Id: I9da6499a38096c8df2025bb9d35ec789864b7c5e
This commit is contained in:
Keith Whyte 2022-06-17 20:39:53 +01:00
parent ea62986928
commit 99bd0f3204
1 changed files with 7 additions and 0 deletions

View File

@ -569,6 +569,13 @@ int db_init(void *ctx, const char *fname, bool enable_sqlite_logging)
/* non-fatal */
}
rc = sqlite3_exec(g_dbc->db, "PRAGMA secure_delete=0;", 0, 0, &err_msg);
if (rc != SQLITE_OK) {
LOGP(DDB, LOGL_ERROR, "Unable to disable SECURE_DELETE: %s\n", err_msg);
sqlite3_free(err_msg);
/* non-fatal */
}
return 0;
}