[rt-users] Searching merged tickets yields missing results

Ben Goodwin ben at atomicmatrix.net
Wed Dec 31 12:47:58 EST 2003


This is definitely a bug.. I'm hoping someone can help narrow down where/how to fix it.  I have three tickets in question.  1269, 1270, and 1271.  1269 and 1270 have been merged.  1271 talks about 1269 and 1270.  The original content of 1269 was simply 'testcandidate1' and 1270 was 'testcandidate2'.  If I search for content like 'testcandidate2' I get no results.  I opened 1271 for myself to resolve this bug which contains 'testcandidate2' in it as well, so searches now show just ticket 1271.  The problem is that the SQL string is limiting to tickets.id = tickets.effectiveid, which will strip out all merged tickets.  d'oh!  Here's a simple command line script and its debug output:

[snip]
my $tickets = new RT::Tickets($RT::SystemUser);
$tickets->LimitContent(VALUE => 'testcandidate2', OPERATOR => 'LIKE');
$tickets->DEBUG(1);
while (my $Ticket = $tickets->Next) {
        print $Ticket->id . "\n";
}
[snip]

RT::Tickets=HASH(0x86034d0)->_GenericRestriction QualifiedField=Attachments_2.Content
RT::Tickets=HASH(0x86034d0)->_GenericRestriction QualifiedField=main.EffectiveId
RT::Tickets=HASH(0x86034d0)->_GenericRestriction QualifiedField=main.Type
DBIx::SearchBuilder->DoSearch Query:  SELECT DISTINCT main.* FROM Tickets main, Transactions Transactions_1, Attachments Attachments_2  WHERE ((main.EffectiveId = main.id)) AND ((main.Type = 'ticket')) AND ( (  ( (Attachments_2.Content LIKE '%testcandidate2%') )  ) )  AND Attachments_2.TransactionId = Transactions_1.id  AND main.id = Transactions_1.Ticket
ID is 1271
1271

If i manually remove the 'main.EffectiveId = main.id' part of the WHERE clause, both 1270 and 1271 show up like they 'should' (though perhaps it should report 1269 instead of 1270 since 1269's the 'real' ticket number now.
Any ideas on how to fix this?

Thanks!

   -=| Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20031231/b1691ae6/attachment.htm>


More information about the rt-users mailing list