summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-17 15:50:44 +0100
committermkanat%kerio.com <>2005-03-17 15:50:44 +0100
commitc70ff10412b775ad58e074508836c2fc1aa760bb (patch)
tree120679f08a0e761be13177fc6fa290572ca32fde
parent763dc81386c22949ec761a3828a0c84150cb68be (diff)
downloadbugzilla-c70ff10412b775ad58e074508836c2fc1aa760bb.tar.gz
bugzilla-c70ff10412b775ad58e074508836c2fc1aa760bb.tar.xz
Bug 284125: PostgreSQL cannot call SUM on a boolean (Boolean Charts)
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
-rw-r--r--Bugzilla/Search.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 3aba68ad9..1f8e53ea3 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -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";
}