From 33fdaaabf5d9e9865a9204515d56cddab5dded00 Mon Sep 17 00:00:00 2001 From: Ra'Jiska Date: Sat, 25 Jul 2026 16:40:28 +0800 Subject: [PATCH] blob_db: Fixes build failure when FLB_SQLDB is flipped off Building with flag -DFLB_SQLDB=Off would result undeclared types as some gated includes were required for a successful build. Signed-off-by: Ra'Jiska --- include/fluent-bit/flb_blob_db.h | 4 ++++ plugins/in_systemd/systemd_config.h | 2 ++ src/flb_blob_db.c | 30 +++++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/include/fluent-bit/flb_blob_db.h b/include/fluent-bit/flb_blob_db.h index fc6ca9c4fa6..c42bc4c67e7 100644 --- a/include/fluent-bit/flb_blob_db.h +++ b/include/fluent-bit/flb_blob_db.h @@ -20,8 +20,12 @@ #ifndef FLB_BLOB_DB_H #define FLB_BLOB_DB_H +#include +#include #include +struct flb_config; + #define SQL_PRAGMA_FOREIGN_KEYS "PRAGMA foreign_keys = ON;" #define SQL_CREATE_BLOB_FILES \ diff --git a/plugins/in_systemd/systemd_config.h b/plugins/in_systemd/systemd_config.h index e9a19617d0f..3356cab83a6 100644 --- a/plugins/in_systemd/systemd_config.h +++ b/plugins/in_systemd/systemd_config.h @@ -23,7 +23,9 @@ #include #include #include +#ifdef FLB_HAVE_SQLDB #include +#endif #include #include diff --git a/src/flb_blob_db.c b/src/flb_blob_db.c index 15b9fbb19db..2e47bf5d47d 100644 --- a/src/flb_blob_db.c +++ b/src/flb_blob_db.c @@ -17,10 +17,11 @@ * limitations under the License. */ +#include + #ifdef FLB_HAVE_SQLDB #include -#include static int prepare_stmts(struct flb_blob_db *context) { @@ -1512,7 +1513,8 @@ int flb_blob_db_file_part_get_next(struct flb_blob_db *context, cfl_sds_t *file_path, cfl_sds_t *destination, cfl_sds_t *remote_file_id, - cfl_sds_t *tag) + cfl_sds_t *tag, + int *part_count) { return FLB_BLOB_DB_ERROR_NO_BACKEND_AVAILABLE; } @@ -1559,4 +1561,28 @@ int flb_blob_db_file_fetch_part_count(struct flb_blob_db *context, return FLB_BLOB_DB_ERROR_NO_BACKEND_AVAILABLE; } +int flb_blob_db_lock(struct flb_blob_db *context) +{ + return FLB_BLOB_DB_ERROR_NO_BACKEND_AVAILABLE; +} + +int flb_blob_db_unlock(struct flb_blob_db *context) +{ + return FLB_BLOB_DB_ERROR_NO_BACKEND_AVAILABLE; +} + +int flb_blob_file_update_remote_id(struct flb_blob_db *context, + uint64_t id, + cfl_sds_t remote_id) +{ + return FLB_BLOB_DB_ERROR_NO_BACKEND_AVAILABLE; +} + +int flb_blob_db_file_part_update_remote_id(struct flb_blob_db *context, + uint64_t id, + cfl_sds_t remote_id) +{ + return FLB_BLOB_DB_ERROR_NO_BACKEND_AVAILABLE; +} + #endif \ No newline at end of file