Closed
Bug 567303
Opened 16 years ago
Closed 16 years ago
VALIDATOR_DEPENDENCIES doesn't always sort field validation properly
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.0
People
(Reporter: mkanat, Assigned: mkanat)
References
Details
Attachments
(1 file, 2 obsolete files)
|
5.02 KB,
patch
|
timello
:
review+
|
Details | Diff | Splinter Review |
Perl uses quicksort, which of course means that it does not compare every value in an array to every other value in an array. Also, it assumes that:
A > B > C === A > C
So if it's already compared A and B, and it's already compared B and C, then it doesn't compare A and C.
In _cmp_dependency, we are currently doing a "cmp" call if we don't explicitly match a dependency. But then we get into the A, B, C situation above. For example:
bug_status > bug_severity
bug_severity > product
Thus, bug_status comes before product, even though it shouldn't.
The simple solution is to make the comparison function always sort non-depdendent fields before any fields with dependencies, because that will assure that fields with dependencies fields always have their comparison done properly against each other.
| Assignee | ||
Comment 1•16 years ago
|
||
So, I think that this will fix the problem. I'm going to do some more extensive testing to be sure.
| Assignee | ||
Updated•16 years ago
|
Attachment #446652 -
Flags: review?(LpSolit) → review-
| Assignee | ||
Comment 2•16 years ago
|
||
Comment on attachment 446652 [details] [diff] [review]
v1
Okay, this doesn't work either. If I pretend like "custom" depends on "visibility_value_id" in Bugzilla::Field, it doesn't work right. I may have to write a custom sort function.
| Assignee | ||
Comment 3•16 years ago
|
||
Wow, welcome to Computer Science land. Okay, here's a patch using a sorting algorithm that is not fast, but is pretty simple and only operates on small sets of data, so we're OK. In all my testing (both on paper and with actual data), this sorts things properly.
Attachment #446652 -
Attachment is obsolete: true
Attachment #446845 -
Flags: review?(timello)
Comment 4•16 years ago
|
||
Alright! I'll check this very soon.
| Assignee | ||
Comment 5•16 years ago
|
||
Oh, um, actually *using* the function might be good, too. :-)
Attachment #446845 -
Attachment is obsolete: true
Attachment #446903 -
Flags: review?(timello)
Attachment #446845 -
Flags: review?(timello)
Comment 6•16 years ago
|
||
Comment on attachment 446903 [details] [diff] [review]
v3
It looks good! As you mentioned, we could sort the @$has_deps alphabetically as we do for the @$no_deps for consistency.
Attachment #446903 -
Flags: review?(timello) → review+
| Assignee | ||
Comment 7•16 years ago
|
||
Thanks for the review, timello! :-)
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Object.pm
modified Bugzilla/Install/Requirements.pm
modified template/en/default/global/code-error.html.tmpl
Committed revision 7195.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Flags: approval?
| Assignee | ||
Updated•16 years ago
|
Flags: approval? → approval+
Comment 8•16 years ago
|
||
Max,
I see that you change the List::MoreUtils requirement version to 0.23 but the latest version I can see is 0.22. install-module.pl scripts says 0.22 is the latest one. Is that right?
Comment 9•16 years ago
|
||
right!
Comment 10•16 years ago
|
||
Reopening! 0.23 doesn't exist, and 0.25_02 is a dev release.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 11•16 years ago
|
||
Maybe you meant 0.13?, see:
0.13 Wed Nov 9 16:29:02 CET 2005
- nearly all functions receiving a CODE-block as first
argument had a hefty memory-leak: Fixed
(spotted by Thomas A. Lowery <tlowery AT cc3 DOT com>)
Comment 12•16 years ago
|
||
(In reply to comment #11)
> Maybe you meant 0.13?
No, 0.23:
http://cpansearch.perl.org/src/VPARSEVAL/List-MoreUtils-0.25_02/Changes
fixed: Big memory leak with XS part()
But 0.23 and 0.24 are not (no longer?) available.
| Assignee | ||
Comment 13•16 years ago
|
||
Right, they had critical bugs.
I've emailed the maintainer to see if he is going to come out with a newer version. In the mean time, I've reduced the requirement to 0.22 so people will at least be able to run 3.7.1:
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Install/Requirements.pm
Committed revision 7199.
Updated•16 years ago
|
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•