Closed Bug 601848 Opened 15 years ago Closed 15 years ago

percentage_complete searches are broken in various ways

Categories

(Bugzilla :: Query/Bug List, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file)

One of the most broken search fields in Search.pm is percentage_complete, mostly because it's using a HAVING clause, so it can't be negated or involved in the AND/OR structure of boolean charts like other fields can.
Blocks: 595448
Blocks: 574940
Attached patch v1Splinter Review
This fully fixes the percentage_complete field! Basically there are two fixes involved: 1) Make actual_time come from a derived table instead of being part of an expression. This allows us to use percentage_complete and actual_time in the WHERE clause instead of in the HAVING clause, fixing most of our problems. 2) Make the percentage_complete column an integer when it's returned by the database, instead of a floating-point number. This makes the behavior of percentage_complete searches predictable and correct across all operators and both tested databases. I choose FLOOR instead of ROUND because that way 99.5% doesn't show up as 100% in buglists.
Assignee: query-and-buglist → mkanat
Status: NEW → ASSIGNED
Attachment #480852 - Flags: review+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Bug.pm modified Bugzilla/Search.pm modified xt/lib/Bugzilla/Test/Search/Constants.pm modified xt/lib/Bugzilla/Test/Search/FieldTest.pm Committed revision 7520.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: approval?
Flags: approval? → approval+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: