diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-07-04 12:11:38 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-07-04 19:36:30 +0100 |
| commit | 61e106fe6a15f76b73125682e91d5c17ee875be2 (patch) | |
| tree | 14727c98dff6b4d5097951c1ec4d238627e5c52e /src/sql.cpp | |
| parent | 409e41d1d97b180233be778a2d23ba0b4328b5c2 (diff) | |
| download | webstat-61e106fe6a15f76b73125682e91d5c17ee875be2.tar.bz2 webstat-61e106fe6a15f76b73125682e91d5c17ee875be2.tar.xz webstat-61e106fe6a15f76b73125682e91d5c17ee875be2.zip | |
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.
Diffstat (limited to 'src/sql.cpp')
| -rw-r--r-- | src/sql.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sql.cpp b/src/sql.cpp index 63e946c..2b91aab 100644 --- a/src/sql.cpp +++ b/src/sql.cpp @@ -16,6 +16,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 |
