Correct, this will not only remove the warning but also return data. So this is not only a warning, it's a plain out critical error.
I made changes to the code to echo the SQL query, and run it manually on Linux.
sqlite3 /etc/pihole/pihole-FTL.db "SELECT timestamp, type, CASE typeof(domain) WHEN 'integer' THEN (SELECT domain FROM domain_by_id d WHERE d.id = q.domain) ELSE domain END domain, CASE typeof(client) WHEN 'integer' THEN ( SELECT CASE TRIM(name) WHEN '' THEN c.ip ELSE c.name END name FROM client_by_id c WHERE c.id = q.client ) ELSE client END client, CASE typeof(forward) WHEN 'integer' THEN (SELECT forward FROM forward_by_id f WHERE f.id = q.forward) ELSE forward END forward, status, reply_type, reply_time, dnssec FROM query_storage q WHERE timestamp >= 1658026800 AND timestamp <= 1658113199 AND status IN (1,2,14,3,4,5,6,7,8,9,10,11,12,13,15,16) ORDER BY timestamp ASC"
Which confirms that data should have been displayed in the UI - it didn't.
So next I compared the SQL to the columns being selected in the code block - scroll below.
SELECT
timestamp,
type,
CASE typeof(domain) WHEN 'integer' THEN (SELECT domain FROM domain_by_id d WHERE d.id = q.domain) ELSE domain END domain,
CASE typeof(client) WHEN 'integer' THEN ( SELECT CASE TRIM(name) WHEN '' THEN c.ip ELSE c.name END name FROM client_by_id c WHERE c.id = q.client ) ELSE client END client,
CASE typeof(forward) WHEN 'integer' THEN (SELECT forward FROM forward_by_id f WHERE f.id = q.forward) ELSE forward END forward,
status,
reply_type,
reply_time,
dnssec
FROM query_storage q
WHERE
timestamp >= :from AND
timestamp <= :until AND
status IN (1,2,14,3,4,5,6,7,8,9,10,11,12,13,15,16)
ORDER BY timestamp ASC
As you can see, the SQL ends on DNSSec column selection, but the code block has an additional client_id (lines 117-127 of api_db.php), which is btw not being JSON encoded on line 130.
// Format, encode, transform each field (if necessary).
$time = $row["timestamp"];
$query_type = getQueryTypeStr($row["type"]); // Convert query type ID to name
$domain = utf8_encode(str_replace("~"," ",$row["domain"]));
$client = $row["client"];
$status = $row["status"];
$destination = utf8_encode($row["forward"]);
$reply_type = $row["reply_type"];
$reply_time = $row["reply_time"];
$dnssec = $row["dnssec"];
$client_id = $row["client_id"];
// Insert into array and output it in JSON format
echo json_encode([$time, $query_type, $domain, $client, $status, $destination, $reply_type, $reply_time, $dnssec]);
Commenting out line 127 resolves this issue.