Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

Query Builder messing up alternative conditions

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


allen+rtlist at crystalfontz

Aug 17, 2009, 12:29 PM

Post #1 of 1 (804 views)
Permalink
Query Builder messing up alternative conditions

I have noticed that when we ask QueryBuilder to search 'Content' for
THIS "OR" THAT, it actually ends up executing SQL that searches for
one condition "THIS AND THAT," causing us to incorrectly get no
results.

For example, TicketSQL (put together using RT's Query Builder search
criteria select form, and then verified in the "Advanced" window:

Content LIKE 'foo' OR Content LIKE 'FOO'

I find in logs executed as (incorrect "AND" aggregator that should
have been "OR" marked with "--->")

[Mon Aug 17 19:07:23 2009] [debug]: SQL(0.000164s):
SELECT COUNT(DISTINCT main.id)
FROM Tickets main
JOIN Transactions Transactions_1 ON ( Transactions_1.ObjectId = main.id )
JOIN Attachments Attachments_2 ON ( Attachments_2.TransactionId =
Transactions_1.id )
WHERE (Transactions_1.ObjectType = 'RT::Ticket')
AND (main.Status != 'deleted')
AND (
( Attachments_2.Filename IS NULL AND Attachments_2.Content LIKE '%foo%' )
---> AND
( Attachments_2.Filename IS NULL AND Attachments_2.Content LIKE '%FOO%' )
)
AND (main.Type = 'ticket')
AND (main.EffectiveId = main.id) ;
(/usr/share/request-tracker3.8/html/autohandler:331)

Does anyone know if this is a bug in RT or in DBx::SearchBuilder? This
problem is really crippling for searching when combined with the fact
that all ticket Content is stored in a MySQL BLOB field which causes
searches to be case-sensitive.

This means users will never find a ticket that contains "Foo" in the
body if they only searched for "foo" (lowercase). And they will never
find it if they try to search for both cases at once in Query Builder
because this bug ANDs the conditions together, requiring both forms to
be present instead of just one.

What can be done to get around this and let people find tickets that
contain "Foo" when they search for "foo" ?

I am on Ubuntu Server 09.04
RT 3.8.4 installed from Ubuntu Karmic package
libdbix-searchbuilder-perl 1.55 package

I also posted this at http://rt3.fsck.com/Ticket/Display.html?id=13775
but don;t know if it is really RT's problem or not, and still would
like to know if there is a workaround.

Allen
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.