Commit c70ff104 authored by mkanat%kerio.com's avatar mkanat%kerio.com

Bug 284125: PostgreSQL cannot call SUM on a boolean (Boolean Charts)

Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
parent 763dc813
......@@ -812,8 +812,8 @@ sub init {
# If the numbers are the same, all flags match the condition,
# so this bug should be included.
if ($t =~ m/not/) {
push(@fields, "SUM($ff IS NOT NULL) AS allflags_$chartid");
push(@fields, "SUM($term) AS matchingflags_$chartid");
push(@fields, "SUM(CASE WHEN $ff IS NOT NULL THEN 1 ELSE 0 END) AS allflags_$chartid");
push(@fields, "SUM(CASE WHEN $term THEN 1 ELSE 0 END) AS matchingflags_$chartid");
push(@having, "allflags_$chartid = matchingflags_$chartid");
$term = "0=0";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment