From 61e106fe6a15f76b73125682e91d5c17ee875be2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 4 Jul 2026 12:11:38 +0100 Subject: Include extra details when storing unparsable and uninsertable lines. Now includes the hostnameId, timestamp and optionally error message. Updates idx_entities_retryinsert to account for details not being NULL. Also fixes the issue where the entities inserted and rollback would still be recorded in the entity cache if the access log insert failed. This would have lead to PK violations later on. --- src/sql.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/sql.cpp') diff --git a/src/sql.cpp b/src/sql.cpp index 63e946c..2b91aab 100644 --- a/src/sql.cpp +++ b/src/sql.cpp @@ -15,6 +15,12 @@ namespace WebStat::SQL { }; const std::string ENTITY_INSERT { #embed "sql/entityInsert.sql" + }; + const std::string UNPARSABLE_INSERT { +#embed "sql/unparsableInsert.sql" + }; + const std::string UNINSERTABLE_INSERT { +#embed "sql/uninsertableInsert.sql" }; const std::string ENTITY_UPDATE_DETAIL { #embed "sql/entityUpdateDetail.sql" @@ -40,6 +46,8 @@ namespace WebStat::SQL { HASH_OPTS(ACCESS_LOG_INSERT); HASH_OPTS(ACCESS_LOG_PURGE_OLD); HASH_OPTS(ENTITY_INSERT); + HASH_OPTS(UNPARSABLE_INSERT); + HASH_OPTS(UNINSERTABLE_INSERT); HASH_OPTS(ENTITY_UPDATE_DETAIL); HASH_OPTS(HOST_UPSERT); const DB::CommandOptionsPtr SELECT_UNINSERTABLE_OPTS -- cgit v1.3