From 16c2f740821811e3d87e21c989aff3cc8fa1bb58 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Sat, 15 Sep 2018 16:25:39 +0200 Subject: [PATCH] Enhance query-logging with timing for MySQL, PostgreSQL and SQLite --- modules/gmysqlbackend/smysql.cc | 10 +++++++++- modules/gpgsqlbackend/spgsql.cc | 13 ++++++++++++- pdns/ssqlite3.cc | 17 +++++++++++++---- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/modules/gmysqlbackend/smysql.cc b/modules/gmysqlbackend/smysql.cc index 67ccac095b..1d851daa91 100644 --- a/modules/gmysqlbackend/smysql.cc +++ b/modules/gmysqlbackend/smysql.cc @@ -162,7 +162,8 @@ public: if (!d_stmt) return this; if (d_dolog) { - g_log<inTransaction(); // try only once while(attempts < 2 && (d_rc = sqlite3_step(d_stmt)) == SQLITE_BUSY) attempts++; @@ -89,9 +91,16 @@ public: throw SSqlException(string("CANTOPEN error in sqlite3, often caused by unwritable sqlite3 db *directory*: ")+string(sqlite3_errmsg(d_db->db()))); throw SSqlException(string("Error while retrieving SQLite query results: ")+string(sqlite3_errmsg(d_db->db()))); } + if(d_dolog) + g_log<