1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-02-13 08:31:59 +00:00

Fix counting of domains at the end of pihole -g. The existing schme used the SQL VIEWs for simplicitly, however, they have the unintended side-effect of - when being queried without a GROUP BY clause - returning entries multiple times if they are assigned to several groups

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2025-02-01 19:42:19 +01:00
parent e682f69a1d
commit 9da1e9ab88
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -864,11 +864,11 @@ gravity_Table_Count() {
gravity_ShowCount() { gravity_ShowCount() {
# Here we use the table "gravity" instead of the view "vw_gravity" for speed. # Here we use the table "gravity" instead of the view "vw_gravity" for speed.
# It's safe to replace it here, because right after a gravity run both will show the exactly same number of domains. # It's safe to replace it here, because right after a gravity run both will show the exactly same number of domains.
gravity_Table_Count "gravity" "gravity domains" "" gravity_Table_Count "gravity" "gravity domains"
gravity_Table_Count "vw_blacklist" "exact denied domains" gravity_Table_Count "domainlist WHERE type = 1" "exact denied domains"
gravity_Table_Count "vw_regex_blacklist" "regex denied filters" gravity_Table_Count "domainlist WHERE type = 3" "regex denied filters"
gravity_Table_Count "vw_whitelist" "exact allowed domains" gravity_Table_Count "domainlist WHERE type = 0" "exact allowed domains"
gravity_Table_Count "vw_regex_whitelist" "regex allowed filters" gravity_Table_Count "domainlist WHERE type = 2" "regex allowed filters"
} }
# Trap Ctrl-C # Trap Ctrl-C