From b736dcee1b57ea45d22a729a68d71db9c83cf965 Mon Sep 17 00:00:00 2001 From: Tyler Karaszewski Date: Thu, 21 Mar 2024 16:02:31 -0700 Subject: [PATCH 1/2] Fix constraints warning --- libstuff/libstuff.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libstuff/libstuff.cpp b/libstuff/libstuff.cpp index 9316ac16f..0f515981d 100644 --- a/libstuff/libstuff.cpp +++ b/libstuff/libstuff.cpp @@ -2683,7 +2683,13 @@ int SQuery(sqlite3* db, const char* e, const string& sql, SQResult& result, int6 string sqlToLog = sql.substr(0, 20000); SRedactSensitiveValues(sqlToLog); - SWARN("'" << e << "', query failed with error #" << error << " (" << sqlite3_errmsg(db) << "): " << sqlToLog); + // We don't warn for constraints errors because sometimes they're allowed, and BedrockCore.cpp will warn for the ones that aren't. + // This prevents creating bugbot issues for the allowed cases. We still log as INFO though so we can diagnose the query with the problem. + if (error == SQLITE_CONSTRAINT) { + INFO("'" << e << "', query failed with error #" << error << " (" << sqlite3_errmsg(db) << "): " << sqlToLog); + } else { + SWARN("'" << e << "', query failed with error #" << error << " (" << sqlite3_errmsg(db) << "): " << sqlToLog); + } } // But we log for commit conflicts as well, to keep track of how often this happens with this experimental feature. From f8485edefd976cb338576be979cba8af3aea5e03 Mon Sep 17 00:00:00 2001 From: Tyler Karaszewski Date: Thu, 21 Mar 2024 16:13:44 -0700 Subject: [PATCH 2/2] Lost an S --- libstuff/libstuff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstuff/libstuff.cpp b/libstuff/libstuff.cpp index 0f515981d..bbbf83143 100644 --- a/libstuff/libstuff.cpp +++ b/libstuff/libstuff.cpp @@ -2686,7 +2686,7 @@ int SQuery(sqlite3* db, const char* e, const string& sql, SQResult& result, int6 // We don't warn for constraints errors because sometimes they're allowed, and BedrockCore.cpp will warn for the ones that aren't. // This prevents creating bugbot issues for the allowed cases. We still log as INFO though so we can diagnose the query with the problem. if (error == SQLITE_CONSTRAINT) { - INFO("'" << e << "', query failed with error #" << error << " (" << sqlite3_errmsg(db) << "): " << sqlToLog); + SINFO("'" << e << "', query failed with error #" << error << " (" << sqlite3_errmsg(db) << "): " << sqlToLog); } else { SWARN("'" << e << "', query failed with error #" << error << " (" << sqlite3_errmsg(db) << "): " << sqlToLog); }