mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/timw/4285-sqlite-threadsafe-check'
* origin/topic/timw/4285-sqlite-threadsafe-check: Force SQLite to be in thread-safe mode during CMake
This commit is contained in:
commit
5cc5f2a275
6 changed files with 19 additions and 25 deletions
8
CHANGES
8
CHANGES
|
@ -1,3 +1,11 @@
|
||||||
|
8.1.0-dev.548 | 2025-09-16 12:41:52 -0700
|
||||||
|
|
||||||
|
* Force SQLite to be in thread-safe mode during CMake (Tim Wojtulewicz, Corelight)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
8.1.0-dev.546 | 2025-09-16 11:31:04 -0700
|
8.1.0-dev.546 | 2025-09-16 11:31:04 -0700
|
||||||
|
|
||||||
* full tracking of the characteristics of globals when compiling scripts to C++ (Vern Paxson, Corelight)
|
* full tracking of the characteristics of globals when compiling scripts to C++ (Vern Paxson, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
8.1.0-dev.546
|
8.1.0-dev.548
|
||||||
|
|
|
@ -467,10 +467,18 @@ set(THIRD_PARTY_SRCS
|
||||||
3rdparty/strsep.c
|
3rdparty/strsep.c
|
||||||
3rdparty/zeek_inet_ntop.c)
|
3rdparty/zeek_inet_ntop.c)
|
||||||
|
|
||||||
if (USE_SQLITE AND WNOERROR_FLAG)
|
if (USE_SQLITE)
|
||||||
|
if (WNOERROR_FLAG)
|
||||||
set_source_files_properties(3rdparty/sqlite3.c PROPERTIES COMPILE_FLAGS ${WNOERROR_FLAG})
|
set_source_files_properties(3rdparty/sqlite3.c PROPERTIES COMPILE_FLAGS ${WNOERROR_FLAG})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# Always force building SQLite in thread-safe mode. This lets us remove sqlite3_threadsafe()
|
||||||
|
# checks in various places, since the library will always be guaranteed to be in thread-safe
|
||||||
|
# mode. This value is the default, but it's set here to be explicit about it.
|
||||||
|
set_source_files_properties(3rdparty/sqlite3.c PROPERTIES COMPILE_DEFINITIONS
|
||||||
|
SQLITE_THREADSAFE=1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
set_source_files_properties(${THIRD_PARTY_SRCS} PROPERTIES SKIP_LINTING ON)
|
set_source_files_properties(${THIRD_PARTY_SRCS} PROPERTIES SKIP_LINTING ON)
|
||||||
|
|
||||||
# Highwayhash. Highwayhash is a bit special since it has architecture dependent
|
# Highwayhash. Highwayhash is a bit special since it has architecture dependent
|
||||||
|
|
|
@ -55,13 +55,6 @@ bool SQLite::checkError(int code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SQLite::DoInit(const ReaderInfo& info, int arg_num_fields, const threading::Field* const* arg_fields) {
|
bool SQLite::DoInit(const ReaderInfo& info, int arg_num_fields, const threading::Field* const* arg_fields) {
|
||||||
if ( sqlite3_threadsafe() == 0 ) {
|
|
||||||
Error(
|
|
||||||
"SQLite reports that it is not threadsafe. Zeek needs a threadsafe version of "
|
|
||||||
"SQLite. Aborting");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow connections to same DB to use single data/schema cache. Also
|
// Allow connections to same DB to use single data/schema cache. Also
|
||||||
// allows simultaneous writes to one file.
|
// allows simultaneous writes to one file.
|
||||||
#ifndef ZEEK_TSAN
|
#ifndef ZEEK_TSAN
|
||||||
|
|
|
@ -96,13 +96,6 @@ bool SQLite::checkError(int code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields, const Field* const* arg_fields) {
|
bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields, const Field* const* arg_fields) {
|
||||||
if ( sqlite3_threadsafe() == 0 ) {
|
|
||||||
Error(
|
|
||||||
"SQLite reports that it is not threadsafe. Zeek needs a threadsafe version of "
|
|
||||||
"SQLite. Aborting");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow connections to same DB to use single data/schema cache. Also
|
// Allow connections to same DB to use single data/schema cache. Also
|
||||||
// allows simultaneous writes to one file.
|
// allows simultaneous writes to one file.
|
||||||
#ifndef ZEEK_TSAN
|
#ifndef ZEEK_TSAN
|
||||||
|
|
|
@ -86,14 +86,6 @@ std::string SQLite::DoGetConfigMetricsLabel() const {
|
||||||
* Called by the manager system to open the backend.
|
* Called by the manager system to open the backend.
|
||||||
*/
|
*/
|
||||||
OperationResult SQLite::DoOpen(OpenResultCallback* cb, RecordValPtr options) {
|
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
|
// Allow connections to same DB to use single data/schema cache. Also
|
||||||
// allows simultaneous writes to one file.
|
// allows simultaneous writes to one file.
|
||||||
#ifndef ZEEK_TSAN
|
#ifndef ZEEK_TSAN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue