Force SQLite to be in thread-safe mode during CMake

This allows us to remove the need to check for thread-safe mode in the
various SQLite plugins. See https://www.sqlite.org/compile.html#threadsafe
for why `1` is a good choice here.
This commit is contained in:
Tim Wojtulewicz 2025-09-16 11:42:21 -07:00
parent bd60c6fc15
commit dd14e380a1
4 changed files with 10 additions and 24 deletions

View file

@ -86,14 +86,6 @@ std::string SQLite::DoGetConfigMetricsLabel() const {
* Called by the manager system to open the backend.
*/
OperationResult SQLite::DoOpen(OpenResultCallback* cb, RecordValPtr options) {
if ( sqlite3_threadsafe() == 0 ) {
std::string res =
"SQLite reports that it is not threadsafe. Zeek needs a threadsafe version of "
"SQLite. Aborting";
Error(res.c_str());
return {ReturnCode::INITIALIZATION_FAILED, std::move(res)};
}
// Allow connections to same DB to use single data/schema cache. Also
// allows simultaneous writes to one file.
#ifndef ZEEK_TSAN