Bug 136885 - divide by zero error when selecting % complete
Summary: divide by zero error when selecting % complete
Alias: None
Product: Bugzilla
Classification: Community
Component: Bugzilla General (Show other bugs)
(Show other bugs)
Version: 3.2
Hardware: All Linux
medium vote
Target Milestone: ---
Assignee: PnT DevOps Devs
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2004-10-22 20:39 UTC by Jeff Needle
Modified: 2013-06-24 02:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-11-21 19:20:54 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Jeff Needle 2004-10-22 20:39:20 UTC
Build Identifier: 

When viewing a bug list, if you change fields to include % complete and any of
the estimate fields contain 0.0 (what are the chances of that happening?), you
get a divide by 0 error.

Reproducible: Always
Steps to Reproduce:
1.View bug 123574, 
2.build the dependency list
3.view as a bug list
4.change fields to add % complete


Actual Results:  

Expected Results:  
Well, if people actually filled in all the estimate fields, it should be OK, but
there will always be slackers who don't, so perhaps put a check in for 0 before
calculating percentage.

DBD::Pg::st execute failed: ERROR:  division by zero on numeric [for
Statement "SELECT bugs.bug_id, bugs.bug_severity, bugs.priority,
bugs.bug_status, bugs.resolution, bugs.remaining_time,
(SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))
AS actual_time, bugs.alias, bugs.bug_severity, bugs.priority,
bugs.rep_platform, map_assigned_to.login_name, bugs.bug_status,
bugs.resolution, (SUM(ldtime.work_time)*COUNT(DISTINCT
ldtime.bug_when)/COUNT(bugs.bug_id)) AS actual_time,
ldtime.bug_when)/COUNT(bugs.bug_id))+bugs.remaining_time))) AS
percentage_complete, bugs.short_desc FROM bugs LEFT JOIN bug_group_map  ON
bug_group_map.bug_id = bugs.bug_id  AND bug_group_map.group_id NOT IN
JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = 81410  , profiles AS
map_assigned_to, longdescs AS ldtime WHERE bugs.assigned_to =
map_assigned_to.userid AND ldtime.bug_id = bugs.bug_id AND (bugs.bug_id IN
((bug_group_map.group_id IS NULL)    OR (bugs.reporter_accessible = 1
AND bugs.reporter = 81410)     OR (bugs.cclist_accessible = 1 AND cc.who
IS NOT NULL)     OR (bugs.assigned_to = 81410) OR (bugs.qa_contact =
81410) ) GROUP BY bugs.bug_id,
BY bugs.bug_status,bugs.bug_id "] at Bugzilla/DB.pm line 74
        Bugzilla::DB::SendSQL('SELECT bugs.bug_id, bugs.bug_severity,
bugs.priority, bugs.bu...') called at /var/www/bugzilla/beta1/buglist.cgi
line 793

Comment 1 David Lawrence 2006-04-08 17:43:01 UTC
Red Hat's current Bugzilla version is 2.18. I am moving all older open bugs to
this version. Any bugs against the older versions will need to be verified that
they are still bugs. This will help me also to sort them better.

Comment 2 David Lawrence 2008-09-16 16:51:25 UTC
Red Hat Bugzilla is now using version 3.2 of the Bugzilla codebase and therefore this bug will need to be re-verified against the new release. With the updated code this bug may no longer be relevant or may have been fixed in the new code.
Updating bug version to 3.2.

Note You need to log in before you can comment on or make changes to this bug.