From 2c91e487fd919e5562461614a1e7aaf117de2812 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 5 Feb 2022 10:11:20 +0100 Subject: [PATCH] Store NULL in the REPLY_TIME column when the reply time is not available Signed-off-by: DL6ER --- src/database/query-table.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/database/query-table.c b/src/database/query-table.c index 50edbcc3..821c218c 100644 --- a/src/database/query-table.c +++ b/src/database/query-table.c @@ -431,8 +431,11 @@ int DB_save_queries(sqlite3 *db) // REPLY_TYPE sqlite3_bind_int(query_stmt, 10, query->reply); - // REPLY_TIME (stored in units of seconds) - sqlite3_bind_double(query_stmt, 11, 1e-4*query->response); + // REPLY_TIME (stored in units of seconds) if available, NULL otherwise + if(query->flags.response_calculated) + sqlite3_bind_double(query_stmt, 11, 1e-4*query->response); + else + sqlite3_bind_null(query_stmt, 11); // DNSSEC sqlite3_bind_int(query_stmt, 12, query->dnssec);