On Wed, Nov 30, 2011 at 09:28:53AM +0100, Nehmer Torben wrote:
> Hi,
> 
> > It wouldn't work. Most times it's easier to use
> > $tickets->FromSQL("Queue = 'x' AND (Status ...)") instead of Limit*
> > calls. LIKE adding % around arguments is historical thing. Use
> > MATCHES.
> 
> Using OPERATOR => 'MATCHES' produces an error:
> 
> [Wed Nov 30 08:15:28 2011] [error]: RestrictionsToClauses: Invalid operator 
> MATCHES for Subject (STRING) at /usr/share/request-tracker4/lib/RT/Tickets.pm 
> line 3363. (/usr/share/request-tracker4/lib/RT/Tickets.pm:3416)
> 
> MATCHES in FromSQL does effectively break the entire query, LIKE in FromSQL 
> has the same bahvoir as LimitSubject.
> 
> Besides, I find it much more error prone to build SQL queries by hand.
> 
> So I am still where I started.
> 
> It can't be that hard to do a query the subject for a string on the beginning 
> without patching the Perl SearchBuilder modules itself, can it?

You want OPERATOR => 'STARTSWITH', documented in DBIx::SearchBuilder
on the Limit method.

-kevin

Attachment: pgpmnJefSQkHR.pgp
Description: PGP signature

--------
RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5 & 6, 2012

Reply via email to