Open Bug 100601 Opened 23 years ago Updated 4 years ago

exclude bugs numbered is horribly inefficient and broken too

Categories

(Bugzilla :: Query/Bug List, defect, P4)

2.15
defect

Tracking

()

People

(Reporter: asa, Unassigned)

References

()

Details

Attachments

(1 file)

when I tried to "exclude" bugs numbered "<a very big list, maybe about 800 bugs> and then a boolean tool "attachment data" contains regexp "+++" I get this error. I don't get the error when I do a "attachment data" contains case insensitive substring "+++" but then the query seems to time out or die on the pondering page. So this bug is actually for the problem of my query not returning results but there is also a problem here that we have a horrible way of doing the exclude bug numbers. Please stand by ... Content-type: text/html Software error: SELECT bugs.bug_id, bugs.groupset, substring(bugs.bug_severity, 1, 3), substring(bugs.priority, 1, 3), substring(bugs.rep_platform, 1, 3), map_assigned_to.login_name, substring(bugs.bug_status,1,4), substring(bugs.resolution,1,4), substring(bugs.short_desc, 1, 60) FROM bugs, profiles map_assigned_to, profiles map_reporter LEFT JOIN profiles map_qa_contact ON bugs.qa_contact = map_qa_contact.userid LEFT JOIN attachments attachments_0 ON bugs.bug_id = attachments_0.bug_id WHERE bugs.assigned_to = map_assigned_to.userid AND bugs.reporter = map_reporter.userid AND bugs.groupset & 3583 = bugs.groupset AND (NOT (lower(bugs.bug_id) regexp '(^|[^a-z0-9])959($|[^a-z0-9])' OR lower(bugs.bug_id) regexp '(^|[^a-z0-9])2436($|[^a-z0-9])' OR lower(bugs.bug_id) regexp '(^|[^a-z0-9])4248($|[^a-z0-9])' OR lower(bugs.bug_id) regexp '(^|[^a-z0-9])4830($|[^a-z0-9])' etc, etc for every bug in the exclude.
I think there's a URL length limit, maybe you hit it.
Summary: exclude bugs numbreed is horribly inefficient and broken too → exclude bugs numbered is horribly inefficient and broken too
while we're at it, something about those regexps just looks WRONG to me. Bug IDs are positive integers. There shouldn't be any other text in the bug_id column. WTF is the [a-z0-9] on either side of the bug id for?
Yeah, there isn't any need for regexps or anything here, just "bug_id IN (...)" or "bug_id NOT IN (...)" conditionals.
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.16
We are currently trying to wrap up Bugzilla 2.16. We are now close enough to release time that anything that wasn't already ranked at P1 isn't going to make the cut. Thus this is being retargetted at 2.18. If you strongly disagree with this retargetting, please comment, however, be aware that we only have about 2 weeks left to review and test anything at this point, and we intend to devote this time to the remaining bugs that were designated as release blockers.
Target Milestone: Bugzilla 2.16 → Bugzilla 2.18
OS: Windows 2000 → All
Hardware: PC → All
Assignee: endico → nobody
nobody@bugzilla.org seems to care about these so they wont make 2.18. If someone adopts them, they can move them back. Retargetting to 2.20
Target Milestone: Bugzilla 2.18 → Bugzilla 2.20
Wow, this still happens on the tip. This is some really silly SQL. I wonder if I can fix it right now...
Assignee: nobody → mkanat
Here's the offending code: > if ($params->param('bug_id')) { > my $type = "anyexact"; > if ($params->param('bugidtype') && $params->param('bugidtype') eq 'exclude') { > $type = "nowords"; > } > push(@specialchart, ["bug_id", $type, join(',', >$params->param('bug_id'))]); > }
OK, this seems to work nicely. I didn't want to just modify anyexact, because I didn't want to quote the arguments (more standards-compliant DBs might complain about it).
Attachment #176357 - Flags: review?(bugreport)
Status: NEW → ASSIGNED
Comment on attachment 176357 [details] [diff] [review] Add a "notanynumber" chart and make Exclude use it Why notanynumber? Why not just notany ? Would probably make sense to move some of the other checks over to that, for things (eg resolutions, etc) that are distinct items rather than phrases.
Comment on attachment 176357 [details] [diff] [review] Add a "notanynumber" chart and make Exclude use it This is the wrong place to fix this as it will only help the hard-coded chart and not the boolean chart. What you want to do is to change the behavior of anyexact in the general query construction if the field is "bug_id" So, you want a funcdef matching.... "^bug_id,anyexact" => sub { and... at that point, you may as well just build the sql right there. (unless you can think of any other use for notanumber)
Attachment #176357 - Flags: review?(bugreport) → review-
(In reply to comment #9) > (From update of attachment 176357 [details] [diff] [review] [edit]) > Why notanynumber? Why not just notany? Because numbers shouldn't be quoted, while strings should be quoted.
(In reply to comment #10) > What you want to do is to change the behavior of anyexact in the general query > construction if the field is "bug_id" > > So, you want a funcdef matching.... > > "^bug_id,anyexact" => sub { Except this is notanyexact, which doesn't exist yet. Also, anyexact quotes its values, while searching for integers shouldn't. While this is fine in MySQL, I have no guarantee that other databases will be so friendly as to automatically cast our varchars to integers. It should probably cover anything which could be a number, although I'm not sure what else in the charts you can search for that would be an integer at this point. I'd have to look into that.
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
Hey Joel, could you help me out with my last comment?
You want to match anyexact and then negate that whole chart. Otherwise, you'll descend into boolean logic hell.
(In reply to comment #14) > You want to match anyexact and then negate that whole chart. Otherwise, you'll > descend into boolean logic hell. OK, yeah, I think that's a good idea. My only question is: how do I do that? I don't know how to negate something, in Search.pm. Right now we have: if ($params->param('bugidtype') && $params->param('bugidtype') eq 'exclude') { $type = "nowords"; } I need to figure out how to keep that as anyexact, and then negate it.
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: Bugzilla 2.22 → Bugzilla 3.2
it's not possible today. I have a patch *somewhere* that introduces a way to do this. in retrospect, I'm pretty sure it could be done w/o the extra structure I created, however I'll try to get those in.
Assignee: mkanat → query-and-buglist
Priority: P2 → P4
Target Milestone: Bugzilla 3.2 → ---
Status: ASSIGNED → NEW
This ugliness still exists in 4.1. :(
(In reply to comment #17) > This ugliness still exists in 4.1. :( Yes it does. It will be possible after the refactoring of boolean charts, or when I add a notanyexact operator.
(In reply to Max Kanat-Alexander from comment #18) > (In reply to comment #17) > > This ugliness still exists in 4.1. :( > > Yes it does. It will be possible a) after the refactoring of boolean charts, > or b) when I add a notanyexact operator. "a" is finished?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: