Bug in Query builder (3.4.5 and 3.6.1)?

Can anyone reproduce this?

Construct a query “A AND B” then change the aggregator to “OR” and add a
condition "C.

The original AND changes to an OR. so it becomes “A OR B OR C”

Same thing happens if you start with OR and add an AND, you end up with
"A AND B AND C".

Happens in 3.4.5 and 3.6.1

The same thing constructed on the command-line with the REST interface
isn’t broken and returns the right thing.

PK

Philip Kime
NOPS Systems Architect
310 401 0407

This isn’t broken, you need to use parenthesis:

A,
OR (
B,
AND C
)

jbw

Philip Kime wrote:

Hmm, but what about this - in the advanced view, I do

Queue = ‘A’ OR ( Status = ‘new’ AND Subject LIKE ‘office’)

I click apply and it becomes:

Queue = ‘A’ AND ( Status = ‘new’ AND Subject LIKE ‘office’)

??From: Joby Walker [mailto:joby@u.washington.edu]
Sent: Thursday, November 02, 2006 7:26 PM
To: Philip Kime
Cc: rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

This isn’t broken, you need to use parenthesis:

A,
OR (
B,
AND C
)

jbw

Philip Kime wrote:

Can anyone reproduce this?

Construct a query “A AND B” then change the aggregator to “OR” and add

a condition "C.

The original AND changes to an OR. so it becomes “A OR B OR C”

Same thing happens if you start with OR and add an AND, you end up
with “A AND B AND C”.

Happens in 3.4.5 and 3.6.1

The same thing constructed on the command-line with the REST interface

isn’t broken and returns the right thing.

PK


Philip Kime
NOPS Systems Architect
310 401 0407



List info:
The rt-devel Archives

Can you test out 3.4.6 and 3.6.2rc1? I believe we dealt with this.On Thu, Nov 02, 2006 at 07:57:18PM -0800, Philip Kime wrote:

Hmm, but what about this - in the advanced view, I do

Queue = ‘A’ OR ( Status = ‘new’ AND Subject LIKE ‘office’)

I click apply and it becomes:

Queue = ‘A’ AND ( Status = ‘new’ AND Subject LIKE ‘office’)

??

-----Original Message-----
From: Joby Walker [mailto:joby@u.washington.edu]
Sent: Thursday, November 02, 2006 7:26 PM
To: Philip Kime
Cc: rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

This isn’t broken, you need to use parenthesis:

A,
OR (
B,
AND C
)

jbw

Philip Kime wrote:

Can anyone reproduce this?

Construct a query “A AND B” then change the aggregator to “OR” and add

a condition "C.

The original AND changes to an OR. so it becomes “A OR B OR C”

Same thing happens if you start with OR and add an AND, you end up
with “A AND B AND C”.

Happens in 3.4.5 and 3.6.1

The same thing constructed on the command-line with the REST interface

isn’t broken and returns the right thing.

PK


Philip Kime
NOPS Systems Architect
310 401 0407



List info:
The rt-devel Archives


List info: The rt-devel Archives

I believe we had this same problem a while back, and the solution
suggested at
http://lists.bestpractical.com/pipermail/rt-devel/2005-August/007507.html
seemed to work fine for us (This may be in 3.6.2rc1, but if an upgrade
isn’t desirable the patch is below).

— html/Search/Build.html Thu Aug 25 17:40:12 2005
+++ html/Search/Build.html Mon Aug 29 21:31:15 2005
@@ -595,6 +595,7 @@
}
elsif ( $current & AGGREG ) {
$ea = $val;

  •        $parentnode->setNodeValue($ea);
           $want = KEYWORD | PAREN;
       }
       elsif ( $current & KEYWORD ) {
    

@@ -652,7 +653,6 @@

         # explicity add a child to it
         $lastnode = RT::Interface::Web::QueryBuilder::Tree->new( 

$clause, $parentnode );

  •        $lastnode->getParent()->setNodeValue($ea);
    
           ( $ea, $key, $op, $value ) = ( "", "", "", "" );
       }
    

-michael

Jesse Vincent wrote:

I haven’t installed 3.4.6 or 3.6.2rc1 yet but I checked the code in
their Build.html and this patch hasn’t been applied to either.

PKFrom: Michael Gilbert [mailto:mdgilb@u.washington.edu]
Sent: Monday, November 06, 2006 12:30 PM
To: Jesse Vincent
Cc: Philip Kime; rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

I believe we had this same problem a while back, and the solution
suggested at
http://lists.bestpractical.com/pipermail/rt-devel/2005-August/007507.htm
l
seemed to work fine for us (This may be in 3.6.2rc1, but if an upgrade
isn’t desirable the patch is below).

— html/Search/Build.html Thu Aug 25 17:40:12 2005
+++ html/Search/Build.html Mon Aug 29 21:31:15 2005
@@ -595,6 +595,7 @@
}
elsif ( $current & AGGREG ) {
$ea = $val;

  •        $parentnode->setNodeValue($ea);
           $want = KEYWORD | PAREN;
       }
       elsif ( $current & KEYWORD ) {
    

@@ -652,7 +653,6 @@

         # explicity add a child to it
         $lastnode = RT::Interface::Web::QueryBuilder::Tree->new(

$clause, $parentnode );

  •        $lastnode->getParent()->setNodeValue($ea);
    
           ( $ea, $key, $op, $value ) = ( "", "", "", "" );
       }
    

-michael

Jesse Vincent wrote:

Can you test out 3.4.6 and 3.6.2rc1? I believe we dealt with this.

Hmm, but what about this - in the advanced view, I do

Queue = ‘A’ OR ( Status = ‘new’ AND Subject LIKE ‘office’)

I click apply and it becomes:

Queue = ‘A’ AND ( Status = ‘new’ AND Subject LIKE ‘office’)

??

-----Original Message-----
From: Joby Walker [mailto:joby@u.washington.edu]
Sent: Thursday, November 02, 2006 7:26 PM
To: Philip Kime
Cc: rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

This isn’t broken, you need to use parenthesis:

A,
OR (
B,
AND C
)

jbw

Philip Kime wrote:

Can anyone reproduce this?

Construct a query “A AND B” then change the aggregator to “OR” and
add

a condition "C.

The original AND changes to an OR. so it becomes “A OR B OR C”

Same thing happens if you start with OR and add an AND, you end up
with “A AND B AND C”.

Happens in 3.4.5 and 3.6.1

The same thing constructed on the command-line with the REST
interface

isn’t broken and returns the right thing.

PK


Philip Kime
NOPS Systems Architect
310 401 0407



List info:
The rt-devel Archives


List info:
The rt-devel Archives

I haven’t installed 3.4.6 or 3.6.2rc1 yet but I checked the code in
their Build.html and this patch hasn’t been applied to either.

Sometimes, there are multiple patches that can fix the same issue. I
can’t 100% assert that that would be the case here, but a quick test
would be much appreciated.

I did a quick test of 3.6.2rc1 and this bug appears not to be fixed in
that release. Will the fix make it to 3.6.2 RTM? Michael’s fix, fixed
the problem if applied to 3.6.1, by the way.

PKFrom: Jesse Vincent [mailto:jesse@bestpractical.com]
Sent: Wednesday, November 08, 2006 11:41 AM
To: Philip Kime
Cc: Michael Gilbert; Jesse Vincent; rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

I haven’t installed 3.4.6 or 3.6.2rc1 yet but I checked the code in
their Build.html and this patch hasn’t been applied to either.

Sometimes, there are multiple patches that can fix the same issue. I
can’t 100% assert that that would be the case here, but a quick test
would be much appreciated.

PK

-----Original Message-----
From: Michael Gilbert [mailto:mdgilb@u.washington.edu]
Sent: Monday, November 06, 2006 12:30 PM
To: Jesse Vincent
Cc: Philip Kime; rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

I believe we had this same problem a while back, and the solution
suggested at
http://lists.bestpractical.com/pipermail/rt-devel/2005-August/007507.h
tm
l
seemed to work fine for us (This may be in 3.6.2rc1, but if an upgrade

isn’t desirable the patch is below).

— html/Search/Build.html Thu Aug 25 17:40:12 2005
+++ html/Search/Build.html Mon Aug 29 21:31:15 2005
@@ -595,6 +595,7 @@
}
elsif ( $current & AGGREG ) {
$ea = $val;

  •        $parentnode->setNodeValue($ea);
           $want = KEYWORD | PAREN;
       }
       elsif ( $current & KEYWORD ) { @@ -652,7 +653,6 @@
    
           # explicity add a child to it
           $lastnode = RT::Interface::Web::QueryBuilder::Tree->new(
    

$clause, $parentnode );

  •        $lastnode->getParent()->setNodeValue($ea);
    
           ( $ea, $key, $op, $value ) = ( "", "", "", "" );
       }
    

-michael

Jesse Vincent wrote:

Can you test out 3.4.6 and 3.6.2rc1? I believe we dealt with this.

Hmm, but what about this - in the advanced view, I do

Queue = ‘A’ OR ( Status = ‘new’ AND Subject LIKE ‘office’)

I click apply and it becomes:

Queue = ‘A’ AND ( Status = ‘new’ AND Subject LIKE ‘office’)

??

-----Original Message-----
From: Joby Walker [mailto:joby@u.washington.edu]
Sent: Thursday, November 02, 2006 7:26 PM
To: Philip Kime
Cc: rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

This isn’t broken, you need to use parenthesis:

A,
OR (
B,
AND C
)

jbw

Philip Kime wrote:

Can anyone reproduce this?

Construct a query “A AND B” then change the aggregator to “OR” and
add

a condition "C.

The original AND changes to an OR. so it becomes “A OR B OR C”

Same thing happens if you start with OR and add an AND, you end up
with “A AND B AND C”.

Happens in 3.4.5 and 3.6.1

The same thing constructed on the command-line with the REST
interface

isn’t broken and returns the right thing.

PK


Philip Kime
NOPS Systems Architect
310 401 0407



List info:
The rt-devel Archives


List info:
The rt-devel Archives

Check out revision 6450 from the repo.On 11/3/06, Philip Kime pkime@shopzilla.com wrote:

Hmm, but what about this - in the advanced view, I do

Queue = ‘A’ OR ( Status = ‘new’ AND Subject LIKE ‘office’)

I click apply and it becomes:

Queue = ‘A’ AND ( Status = ‘new’ AND Subject LIKE ‘office’)

??

-----Original Message-----
From: Joby Walker [mailto:joby@u.washington.edu]
Sent: Thursday, November 02, 2006 7:26 PM
To: Philip Kime
Cc: rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

This isn’t broken, you need to use parenthesis:

A,
OR (
B,
AND C
)

jbw

Philip Kime wrote:

Can anyone reproduce this?

Construct a query “A AND B” then change the aggregator to “OR” and add

a condition "C.

The original AND changes to an OR. so it becomes “A OR B OR C”

Same thing happens if you start with OR and add an AND, you end up
with “A AND B AND C”.

Happens in 3.4.5 and 3.6.1

The same thing constructed on the command-line with the REST interface

isn’t broken and returns the right thing.

PK


Philip Kime
NOPS Systems Architect
310 401 0407



List info:
The rt-devel Archives


List info: The rt-devel Archives

Best regards, Ruslan.

Looks fixed in 6450, thanks - guessing this will become 3.6.2?

PkFrom: Ruslan Zakirov [mailto:ruslan.zakirov@gmail.com]
Sent: Thursday, November 16, 2006 2:10 PM
To: Philip Kime
Cc: Joby Walker; rt-devel@lists.bestpractical.com
Subject: Re: [Rt-devel] Bug in Query builder (3.4.5 and 3.6.1)?

Check out revision 6450 from the repo.