From d96d3775064874f29d46ec931cfe5370e8623645 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Tue, 26 Oct 2021 21:30:09 +0200 Subject: [PATCH] add wildcard search for domain name --- Apps/QueryLogsSqliteApp/App.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Apps/QueryLogsSqliteApp/App.cs b/Apps/QueryLogsSqliteApp/App.cs index 2a52e0ae..35fe6fb3 100644 --- a/Apps/QueryLogsSqliteApp/App.cs +++ b/Apps/QueryLogsSqliteApp/App.cs @@ -420,7 +420,7 @@ CREATE TABLE IF NOT EXISTS dns_logs whereClause += "rcode = @rcode AND "; if (qname is not null) - whereClause += "qname = @qname AND "; + whereClause += "qname like @qname AND "; if (qtype is not null) whereClause += "qtype = @qtype AND "; @@ -461,7 +461,7 @@ CREATE TABLE IF NOT EXISTS dns_logs command.Parameters.AddWithValue("@rcode", (byte)rcode); if (qname is not null) - command.Parameters.AddWithValue("@qname", qname); + command.Parameters.Add(new SqliteParameter("@qname", "%"+qname+"%")); if (qtype is not null) command.Parameters.AddWithValue("@qtype", (ushort)qtype); @@ -540,7 +540,7 @@ ORDER BY row_num" + (descendingOrder ? " DESC" : ""); command.Parameters.AddWithValue("@rcode", (byte)rcode); if (qname is not null) - command.Parameters.AddWithValue("@qname", qname); + command.Parameters.AddWithValue("@qname", "%"+qname+"%"); if (qtype is not null) command.Parameters.AddWithValue("@qtype", (ushort)qtype);