Closed Bug 600495 Opened 14 years ago Closed 14 years ago

Searching by field ranges fails when chfieldto specified

Categories

(Bugzilla :: Query/Bug List, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Bugzilla 4.2

People

(Reporter: gerv, Assigned: mkanat)

References

Details

Attachments

(2 files, 1 obsolete file)

4.0: https://landfill.bugzilla.org/bugzilla-4.0-branch/buglist.cgi?chfieldto=2007-07-03&chfield=status_whiteboard&chfieldfrom=2007-07-01&chfieldvalue=nothingafds

=> One bug found.

Tip: https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?chfieldto=2007-07-03&chfield=status_whiteboard&chfieldfrom=2007-07-01&chfieldvalue=nothingafds

=> Zarro boogs.

This query picks out a change from many years ago, which is identical in the two databases. Removing chfieldto from the second URL shows up the bug (and another one, as it happens).
I actually just re-discovered this independently, and have a fix for it.
Target Milestone: --- → Bugzilla 4.2
Attached patch v1 (obsolete) — Splinter Review
During refactoring, I added an optimization for chfieldto and chfieldfrom that added a delta_ts term into the SQL (which considerably speeds things up). However, logically that's only valid for chfieldfrom--there's no similar optimization that I can think of at the moment that's possible for chfieldto.
Assignee: query-and-buglist → mkanat
Status: NEW → ASSIGNED
Attachment #480425 - Flags: review+
Attached patch v2Splinter Review
Oops, v1 included some extra code.
Attachment #480425 - Attachment is obsolete: true
Attachment #480426 - Flags: review+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/Search.pm
Committed revision 7504.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Blocks: 601383
There's still something wrong here (may be a different bug, perhaps):

https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?chfieldto=1980-07-03&bug_id=1&chfieldfrom=1980-07-04

This should return no bugs - the range of dates is empty, as well as both dates being well before any time the bug was changed. The problem still occurs even if chfieldto is after chfieldfrom:

https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?chfieldto=1980-07-06&bug_id=1&chfieldfrom=1980-07-04

Gerv
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Ah, you're right.

If somebody doesn't specify a field value or a particular field that's changed, then the chfieldto parameter *does* need to check the delta_ts column.
Attached patch Fix chfieldtoSplinter Review
This patch fixes chfieldto to work by itself, and also adds tests to xt/search.t to make sure that we don't regress this in the future.
Attachment #481472 - Flags: review+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/Search.pm
modified xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
Committed revision 7524.
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Yes, the relevant bzapi tests now pass.

Gerv
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: