[rt-users] Query Builder documentation

Jesse Vincent jesse at bestpractical.com
Fri Feb 25 00:25:29 EST 2005




On Fri, Feb 25, 2005 at 12:20:02AM -0500, Stephen Hancock wrote:
> You are correct. My solution only works to one level of AND/OR.
> Apparently the Query Builder will not allow the two on the same level.
> 
> It will allow you to build a statement like:
> 
> que = 'gripe'
> AND
>     status = 'new'
>     OR status = 'open'
> 
> But not:
> que = 'gripe
> AND
>    status = ''
>    OR status = ''
> OR
>    whatever......
> 
> The operators change when moving from from Advanced to Query Builder
> and the toggle is inconsistent, sometimes changing all operators or
> all on one level instead of only the line selected.
> 
> This must be a bug - and a serious one since there does not seem to be
> a workaround with the advanced option. At least one that I can find.

add parens. "()"

> It would be better if the advanced just took straight SQL queries and
> did not reformat them for the query builder. It would be ugly but
> would probably work.

That would also expose RT to all sorts of sql injection attacks.


> I think the question now seems to be is there a way to pass a SQL
> statement that will not be parsed to the db? and still be able to save
> the query?
> 
> 
> 
> On Thu, 24 Feb 2005 13:26:14 -0500, Duncan Hutty <dhutty+rt at ece.cmu.edu> wrote:
> > On 01/31/2005 07:27 AM, Stephen Hancock wrote:
> > > Matthew,
> > >
> > > The QueryBuilder  doesn't like to mix AND and OR. I have had to get
> > > several statements up with the QueryBuilder and then go to the
> > > Advanced Menu to finish the statement. The Advanced menu will accept
> > > mixed statements just fine. I would suggest saving some  typical
> > > queries as templates and then allow users to load them and plug in the
> > > valuses they want.
> > 
> > rt-3.4.1
> > While preparing queries, I have seen the problems with the query builder
> > not mixing AND and OR operators. Therefore attempting to follow the
> > above advice, I went to 'Advanced' and modified by hand.
> > I changed this:
> > ( Queue = 'gripe'  AND Status = 'new' ) AND ( Owner = '32'  AND Status =
> > 'open' )
> > 
> > to this:
> > ( Queue = 'gripe'  AND Status = 'new' ) OR ( Owner = '32'  AND Status =
> > 'open' )
> > 
> > Then I clicked apply. RT then returned me to the query builder page and
> > the query is changed back to the original.
> > 
> > Suggestions?
> > 
> > --
> > Duncan Hutty
> > System Administrator
> > Electrical and Computer Engineering
> > Carnegie Mellon University
> > _______________________________________________
> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> > 
> > RT Administrator and Developer training is coming to your town soon! (Boston, San Francisco, Austin, Sydney) Contact training at bestpractical.com for details.
> > 
> > Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> > 
> >
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> RT Administrator and Developer training is coming to your town soon! (Boston, San Francisco, Austin, Sydney) Contact training at bestpractical.com for details.
> 
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
> 

-- 



More information about the rt-users mailing list