Bug 484584

Summary: "doesn't contain string" limit doesn't work
Product: [Community] Bugzilla Reporter: Matěj Cepl <mcepl>
Component: Query/Bug ListAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 3.6   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-19 05:27:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 1 Matěj Cepl 2009-02-08 18:01:25 UTC
Actual results:

105 bugs

Expected results:

less (look at few at the top, which do contain Backtrace: word in commentary)

Comment 2 David Lawrence 2009-05-26 15:26:53 UTC
The attached URL generates the following SQL (add &debug=1 to end of URL):

SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status, bugs.resolution, map_products.name, AliasList(bugs.bug_id) AS alias, map_assigned_to.login_name, bugs.bug_status, map_components.name, bugs.votes, bugs.short_desc, bugs.cf_devel_whiteboard FROM bugs INNER JOIN profiles AS map_assigned_to ON (bugs.assigned_to = map_assigned_to.userid) INNER JOIN products AS map_products ON (bugs.product_id = map_products.id) INNER JOIN components AS map_components ON (bugs.component_id = map_components.id) INNER JOIN attachments AS attachments_0 ON (bugs.bug_id = attachments_0.bug_id ) INNER JOIN attach_data AS attachdata_0 ON (attachdata_0.id = attachments_0.attach_id) LEFT JOIN longdescs AS longdescs_THETEXT ON (longdescs_THETEXT.bug_id = bugs.bug_id ) LEFT JOIN bug_group_map ON bug_group_map.bug_id = bugs.bug_id LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = 6 WHERE (( bugs.bug_status IN ('NEW','ASSIGNED','M') )) AND (( bugs.component_id IN (1303,1304,1306,1307,7606,10543,11507,15144,20307,35191,42331,49541,57941,69291,19359,58071,69421,27307,29691,29661,32141,31791,32291,31711,13772,17570,50561,91352,2392,2393,2394,2395,2396,27299,17102,60491,71841,26719,31511,17136,20481,61901,73251,81551,17137,20560,61911,73261,91462,17138,20433,61951,73301,17103,20428,61411,72761,17104,20509,61421,72771,17105,20404,61441,72791,21319,21673,19882,87440,87441,87442,90818,3881,3882,3883,3884,10807,11838,16050,20528,45021,52781,62481,73831,17106,20407,33391,61451,72801,89715,17142,20587,62511,73861,192,193,194,195,196,198,7515,17464,20549,34271,62981,74331,80081,91467,19843,16873,5500,5501,5502,5503,10967,12047,16080,20483,46681,54611,64881,76231,13071,13101,15394,20338,55461,66001,77351,80391,19448,6949,6950,512,513,514,19360,20579,32131,66961,78311,19375,13463,13464,15443,56501,80601,81871,17144,67031,78381,19379,17145,20217,67041,78391,17146,20071,67051,78401,17147,20037,67061,78411,19370,26919,17148,20214,67071,78421,17149,20098,67081,78431,18540,20532,67091,78441,17150,20072,67101,78451,80701,81211,29671,17151,20086,67111,78461,17152,20141,67121,78471,17153,20213,67131,78481,86211,17154,20191,67141,78491,17155,20315,67151,78501,87696,17156,20042,67161,78511,17157,20239,67171,78521,17158,20336,67181,78531,17159,20081,67191,78541,17160,20018,67201,78551,17161,20155,67211,78561,17162,20138,33441,67221,78571,17163,20182,33451,67231,78581,81401,17164,20306,67241,78591,88097,17165,20255,67251,78601,17166,20311,67261,78611,17167,20295,67271,78621,17168,20183,67281,78631,17169,20175,67291,78641,82681,91254,31971,17170,20111,67301,78651,17171,20256,67311,78661,17172,20265,33401,67321,78671,89100,17173,20108,67331,78681,17174,20130,67341,78691,17175,20107,67351,78701,17176,20228,67361,78711,17177,20232,33461,67371,78721,81441,17178,20233,67381,78731,17179,20119,67391,78741,87802,17180,20102,67401,78751,17181,20301,67411,78761,32571,87481,17182,20243,67421,78771,17183,20274,67431,78781,91939,89122,31501,17184,20268,67441,78791,17185,20258,67451,78801,17186,20339,67461,78811,17187,20088,67471,78821,17188,20215,67481,78831,17189,20352,67491,78841,17190,20188,67501,78851,17191,20202,67511,78861,17192,20164,67521,78871,88616,88619,88606,88605,88617,88618,88604,89118,17193,20101,67531,78881,17194,23062,67541,78891,17195,20300,67551,78901,17196,20027,67561,78911,17225,20329,67571,78921,17197,20230,67581,78931,22866,17198,20097,67591,78941,81571,17199,20057,67601,78951,81511,17200,20169,67611,78961,18133,20535,67621,78971,17201,20143,67631,78981,86201,17202,20323,33411,67641,78991,17203,20126,67651,79001,87689,17234,20178,67661,79011,89792,17204,20105,67671,79021,17205,20019,67681,79031,82731,17206,34131,67691,79041,17207,67701,79051,17208,20123,26921,67711,79061,81361,17209,20219,67721,79071,17210,20337,67731,79081,17211,67741,79091,17212,20262,67751,79101,89021,17213,20472,67761,79111,17214,67771,79121,17215,83161,17216,20200,67781,79131,81821,17217,67791,79141,17218,20008,67801,79151,17219,20316,67811,79161,82791,17220,17221,67821,79171,17222,67831,79181,13449,13450,17670,56521,67841,79191,7303,7304,7305,7306,8221,11139,12245,15959,20439,41311,48371,56551,67861,79211) ) AND (attachdata_0.thedata REGEXP '[[.newline.]][[:space:]]*Backtrace:') AND (INSTR(longdescs_THETEXT.thetext, 'Backtrace:') = 0)) AND bugs.creation_ts IS NOT NULL AND ((bug_group_map.group_id IS NULL) OR (bug_group_map.group_id IN (96,134,191,113,111,205,190,128,129,127,58,159,122,133,13,126,93,17,99,71,202,197,162,8,110,31,153,23,108,63,24,139,124,150,135,102,85,57,136,204,125,98,38,147,86,106,70,152,68,148,132,67,6,65,192,161,171,20,151,50,27,10,109,187,100,196,101,105,121,3,92,114,21,1,116,83,186,74,103,81,34,157,149,198,207,138,201,2,12,140,144,79,76,97,195,182,35,7,120,146,189,84,131,107,32,4,78,14,200,69,123,44,19,183,82,87,143,15,137,80,194,155,117,95,199,75,118,130,29,181,41,9,112,141,185,11,119,104,206,33,22,18,56,48,145,184,16,188,91,25,154,156,193,30,142,5,94)) OR (bugs.reporter_accessible = 1 AND bugs.reporter = 6) OR (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL) OR (bugs.assigned_to = 6) OR (bugs.qa_contact = 6) ) GROUP BY bugs.bug_id ORDER BY bugs.bug_id

For some reason the (INSTR(longdescs_THETEXT.thetext, 'Backtrace:') = 0) part is not filtering as it should.

Tony, do you have time to analyze this and see why it is failing?

Another way to do this is to add another boolean chart, negate it, and use 
"Content" "matches" "Backtrace:". This brings up 59 bugs instead.

https://bugzilla.redhat.com/buglist.cgi?query_format=advanced&bug_status=NEW&bug_status=ASSIGNED&bug_status=MODIFIED&known_name=XGL w%2Fbacktrace w%2Fo comment&query_based_on=XGL w%2Fbacktrace w%2Fo comment&field0-0-0=component&type0-0-0=regexp&value0-0-0=xorg|X11|compiz|chkfontpath|imake|libdmx|libdrm|libfontenc|libFS|libICE|libSM|libwnck|libxkbfile|mesa|pyxf86config|system-config-display|xkeyboard-config|xrestop|xsri&field0-1-0=attach_data.thedata&type0-1-0=regexp&value0-1-0=[[.newline.]][[%3Aspace%3A]]*Backtrace%3A&negate1=1&field1-0-0=content&type1-0-0=matches&value1-0-0=Backtrace%3A

Comment 3 Tony Fu 2009-07-07 06:57:26 UTC
Dave,

I think this one is caused by the way of storing comments in bugs.longdescs table (one bug may have more than one entries).  

For example, we assume a bug (bug_id=1) has three pieces of comment: One includes "Backtrace:", the other two doesn't include "Backtrace:".  The entries of this bug in longdescs will be 
bug_id    thetext
---------------------------
1         "Backtrace: ...."
1         "........."
1         "........."

After the query joins the longdescs table, there will be three entries for bug #1 in joined table and only last two entries without "Backtrace:" can be eliminated by the clause (INSTR(longdescs_THETEXT.thetext, 'Backtrace:') = 0)), but the first one with "Backtrace:" will remain in joined table, so the bug #1 will appear in the final bug list.

It seems no easy way to fix this issues (I think upstream has the same issue).  If we join full_text instead of longdescs table, the query which uses more then one boolean charts to query the comments may return the wrong result.  I think someone in upstream mentioned to separate the comment query from other queries, so the code can give the comment related queries a special treatment.


Tony

(In reply to comment #2)
> The attached URL generates the following SQL (add &debug=1 to end of URL):
> 
> SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status,
> bugs.resolution, map_products.name, AliasList(bugs.bug_id) AS alias,
> map_assigned_to.login_name, bugs.bug_status, map_components.name, bugs.votes,
> bugs.short_desc, bugs.cf_devel_whiteboard FROM bugs INNER JOIN profiles AS
> map_assigned_to ON (bugs.assigned_to = map_assigned_to.userid) INNER JOIN
> products AS map_products ON (bugs.product_id = map_products.id) INNER JOIN
> components AS map_components ON (bugs.component_id = map_components.id) INNER
> JOIN attachments AS attachments_0 ON (bugs.bug_id = attachments_0.bug_id )
> INNER JOIN attach_data AS attachdata_0 ON (attachdata_0.id =
> attachments_0.attach_id) LEFT JOIN longdescs AS longdescs_THETEXT ON
> (longdescs_THETEXT.bug_id = bugs.bug_id ) LEFT JOIN bug_group_map ON
> bug_group_map.bug_id = bugs.bug_id LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND
> cc.who = 6 WHERE (( bugs.bug_status IN ('NEW','ASSIGNED','M') )) AND ((
> bugs.component_id IN
> (1303,1304,1306,1307,7606,10543,11507,15144,20307,35191,42331,49541,57941,69291,19359,58071,69421,27307,29691,29661,32141,31791,32291,31711,13772,17570,50561,91352,2392,2393,2394,2395,2396,27299,17102,60491,71841,26719,31511,17136,20481,61901,73251,81551,17137,20560,61911,73261,91462,17138,20433,61951,73301,17103,20428,61411,72761,17104,20509,61421,72771,17105,20404,61441,72791,21319,21673,19882,87440,87441,87442,90818,3881,3882,3883,3884,10807,11838,16050,20528,45021,52781,62481,73831,17106,20407,33391,61451,72801,89715,17142,20587,62511,73861,192,193,194,195,196,198,7515,17464,20549,34271,62981,74331,80081,91467,19843,16873,5500,5501,5502,5503,10967,12047,16080,20483,46681,54611,64881,76231,13071,13101,15394,20338,55461,66001,77351,80391,19448,6949,6950,512,513,514,19360,20579,32131,66961,78311,19375,13463,13464,15443,56501,80601,81871,17144,67031,78381,19379,17145,20217,67041,78391,17146,20071,67051,78401,17147,20037,67061,78411,19370,26919,17148,20214,67071,78421,17149,20098,67081,78431,18540,20532,67091,78441,17150,20072,67101,78451,80701,81211,29671,17151,20086,67111,78461,17152,20141,67121,78471,17153,20213,67131,78481,86211,17154,20191,67141,78491,17155,20315,67151,78501,87696,17156,20042,67161,78511,17157,20239,67171,78521,17158,20336,67181,78531,17159,20081,67191,78541,17160,20018,67201,78551,17161,20155,67211,78561,17162,20138,33441,67221,78571,17163,20182,33451,67231,78581,81401,17164,20306,67241,78591,88097,17165,20255,67251,78601,17166,20311,67261,78611,17167,20295,67271,78621,17168,20183,67281,78631,17169,20175,67291,78641,82681,91254,31971,17170,20111,67301,78651,17171,20256,67311,78661,17172,20265,33401,67321,78671,89100,17173,20108,67331,78681,17174,20130,67341,78691,17175,20107,67351,78701,17176,20228,67361,78711,17177,20232,33461,67371,78721,81441,17178,20233,67381,78731,17179,20119,67391,78741,87802,17180,20102,67401,78751,17181,20301,67411,78761,32571,87481,17182,20243,67421,78771,17183,20274,67431,78781,91939,89122,31501,17184,20268,67441,78791,17185,20258,67451,78801,17186,20339,67461,78811,17187,20088,67471,78821,17188,20215,67481,78831,17189,20352,67491,78841,17190,20188,67501,78851,17191,20202,67511,78861,17192,20164,67521,78871,88616,88619,88606,88605,88617,88618,88604,89118,17193,20101,67531,78881,17194,23062,67541,78891,17195,20300,67551,78901,17196,20027,67561,78911,17225,20329,67571,78921,17197,20230,67581,78931,22866,17198,20097,67591,78941,81571,17199,20057,67601,78951,81511,17200,20169,67611,78961,18133,20535,67621,78971,17201,20143,67631,78981,86201,17202,20323,33411,67641,78991,17203,20126,67651,79001,87689,17234,20178,67661,79011,89792,17204,20105,67671,79021,17205,20019,67681,79031,82731,17206,34131,67691,79041,17207,67701,79051,17208,20123,26921,67711,79061,81361,17209,20219,67721,79071,17210,20337,67731,79081,17211,67741,79091,17212,20262,67751,79101,89021,17213,20472,67761,79111,17214,67771,79121,17215,83161,17216,20200,67781,79131,81821,17217,67791,79141,17218,20008,67801,79151,17219,20316,67811,79161,82791,17220,17221,67821,79171,17222,67831,79181,13449,13450,17670,56521,67841,79191,7303,7304,7305,7306,8221,11139,12245,15959,20439,41311,48371,56551,67861,79211)
> ) AND (attachdata_0.thedata REGEXP '[[.newline.]][[:space:]]*Backtrace:') AND
> (INSTR(longdescs_THETEXT.thetext, 'Backtrace:') = 0)) AND bugs.creation_ts IS
> NOT NULL AND ((bug_group_map.group_id IS NULL) OR (bug_group_map.group_id IN
> (96,134,191,113,111,205,190,128,129,127,58,159,122,133,13,126,93,17,99,71,202,197,162,8,110,31,153,23,108,63,24,139,124,150,135,102,85,57,136,204,125,98,38,147,86,106,70,152,68,148,132,67,6,65,192,161,171,20,151,50,27,10,109,187,100,196,101,105,121,3,92,114,21,1,116,83,186,74,103,81,34,157,149,198,207,138,201,2,12,140,144,79,76,97,195,182,35,7,120,146,189,84,131,107,32,4,78,14,200,69,123,44,19,183,82,87,143,15,137,80,194,155,117,95,199,75,118,130,29,181,41,9,112,141,185,11,119,104,206,33,22,18,56,48,145,184,16,188,91,25,154,156,193,30,142,5,94))
> OR (bugs.reporter_accessible = 1 AND bugs.reporter = 6) OR
> (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL) OR (bugs.assigned_to = 6)
> OR (bugs.qa_contact = 6) ) GROUP BY bugs.bug_id ORDER BY bugs.bug_id
> 
> For some reason the (INSTR(longdescs_THETEXT.thetext, 'Backtrace:') = 0) part
> is not filtering as it should.
> 
> Tony, do you have time to analyze this and see why it is failing?
> 
> Another way to do this is to add another boolean chart, negate it, and use 
> "Content" "matches" "Backtrace:". This brings up 59 bugs instead.
> 
> https://bugzilla.redhat.com/buglist.cgi?query_format=advanced&bug_status=NEW&bug_status=ASSIGNED&bug_status=MODIFIED&known_name=XGL
> w%2Fbacktrace w%2Fo comment&query_based_on=XGL w%2Fbacktrace w%2Fo
> comment&field0-0-0=component&type0-0-0=regexp&value0-0-0=xorg|X11|compiz|chkfontpath|imake|libdmx|libdrm|libfontenc|libFS|libICE|libSM|libwnck|libxkbfile|mesa|pyxf86config|system-config-display|xkeyboard-config|xrestop|xsri&field0-1-0=attach_data.thedata&type0-1-0=regexp&value0-1-0=[[.newline.]][[%3Aspace%3A]]*Backtrace%3A&negate1=1&field1-0-0=content&type1-0-0=matches&value1-0-0=Backtrace%3A

Comment 4 David Lawrence 2010-01-15 16:55:42 UTC
Red Hat Bugzilla is now using version 3.4 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.4.

Comment 5 Matěj Cepl 2010-01-16 08:17:25 UTC
I have created a tinyurl for the reproducer query http://tinyurl.com/rhbz484584 and it found https://bugzilla.redhat.com/show_bug.cgi?id=506421 which contains Backtrace:

Comment 6 David Lawrence 2010-08-25 21:43:49 UTC
Red Hat has now upgraded to Bugzilla 3.6 and this bug will now be reassigned to that version. It would be helpful to the Bugzilla Development Team if this bug is verified to still be an issue with the latest version. If it is no longer an issue, then feel free to close, otherwise please comment that it is still a problem and we will try to address the issue as soon as we can.

Thanks
Bugzilla Development Team

Comment 7 Matěj Cepl 2010-08-26 10:23:06 UTC
still live and kicking

Comment 8 Jeff Fearn 🐞 2012-05-30 04:46:48 UTC
As part of the recent Bugzilla 2.4 upgrade the Bugzilla team are cleaning up bugs opened against old versions of Bugzilla. This bug has been flagged as an old bug and will be CLOSED WONTFIX in 7 days time.

If you believe this bug is an issue in the latest Bugzilla version please comment on this bug within 7 days. Doing so will ensure this bug is not closed automatically.

Thanks, the Bugzilla team.

Comment 9 Jeff Fearn 🐞 2012-07-19 05:27:48 UTC
As noted previously, the Bugzilla Team is cleaning up a large number of outstanding issues that have bit rotted. This bug is being closed as there has been no response to that notification.

If you believe this bug is still important please reopen this bug in the NEW status and PM will consider it.