You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Szymon Kuzniak (JIRA)" <ji...@apache.org> on 2006/09/06 09:01:22 UTC
[jira] Created: (JCR-562) 'OR' in XPath query badly interpreted
'OR' in XPath query badly interpreted
-------------------------------------
Key: JCR-562
URL: http://issues.apache.org/jira/browse/JCR-562
Project: Jackrabbit
Issue Type: Bug
Components: core
Affects Versions: 1.0.1
Reporter: Szymon Kuzniak
Attachments: tree.JPG
executing query: //*[@a=1 and @b=2 or @c=3] leads to creating wrong query tree. The builded tree looks like for query: //*[@a=1 and @b=2 and @c=3](see attachement). using brackets resolves the problem, but without brackets output query is different from input query. When AND and OR are switched(so the OR is in first palce - //*[@a=1 or @b=2 and @c=3]) everything is ok.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (JCR-562) 'OR' in XPath query badly interpreted
Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-562?page=all ]
Marcel Reutegger resolved JCR-562.
----------------------------------
Resolution: Fixed
Applied patch as proposed in revision: 464466
Thank you for reporting this issue.
> 'OR' in XPath query badly interpreted
> -------------------------------------
>
> Key: JCR-562
> URL: http://issues.apache.org/jira/browse/JCR-562
> Project: Jackrabbit
> Issue Type: Bug
> Components: core
> Affects Versions: 1.0.1
> Reporter: Szymon Kuzniak
> Attachments: JCR-562.patch, tree.JPG
>
>
> executing query: //*[@a=1 and @b=2 or @c=3] leads to creating wrong query tree. The builded tree looks like for query: //*[@a=1 and @b=2 and @c=3](see attachement). using brackets resolves the problem, but without brackets output query is different from input query. When AND and OR are switched(so the OR is in first palce - //*[@a=1 or @b=2 and @c=3]) everything is ok.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (JCR-562) 'OR' in XPath query badly interpreted
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-562?page=all ]
Jukka Zitting updated JCR-562:
------------------------------
Component/s: xpath
(was: core)
Fix Version/s: 1.1.1
Affects Version/s: 0.9
1.0
1.1
> 'OR' in XPath query badly interpreted
> -------------------------------------
>
> Key: JCR-562
> URL: http://issues.apache.org/jira/browse/JCR-562
> Project: Jackrabbit
> Issue Type: Bug
> Components: xpath
> Affects Versions: 1.0, 1.0.1, 1.1, 0.9
> Reporter: Szymon Kuzniak
> Fix For: 1.1.1
>
> Attachments: JCR-562.patch, tree.JPG
>
>
> executing query: //*[@a=1 and @b=2 or @c=3] leads to creating wrong query tree. The builded tree looks like for query: //*[@a=1 and @b=2 and @c=3](see attachement). using brackets resolves the problem, but without brackets output query is different from input query. When AND and OR are switched(so the OR is in first palce - //*[@a=1 or @b=2 and @c=3]) everything is ok.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (JCR-562) 'OR' in XPath query badly interpreted
Posted by "Przemo Pakulski (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-562?page=all ]
Przemo Pakulski updated JCR-562:
--------------------------------
Attachment: JCR-562.patch
The attached patch contains fix and following test case :
public void testLogicalExpression() throws Exception {
Node foo = testRootNode.addNode("foo");
foo.setProperty("a", 1);
foo.setProperty("b", 2);
foo.setProperty("c", 3);
Node bar = testRootNode.addNode("bar");
bar.setProperty("a", 0);
bar.setProperty("b", 2);
bar.setProperty("c", 0);
Node bla = testRootNode.addNode("bla");
bla.setProperty("a", 1);
bla.setProperty("b", 0);
bla.setProperty("c", 3);
testRootNode.save();
String sql = "SELECT * FROM nt:unstructured WHERE a=1 and b=2 or c=3";
Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
QueryResult result = q.execute();
checkResult(result, new Node[]{foo, bla});
String xpath = "//*[@a=1 and @b=2 or @c=3] ";
q = superuser.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
result = q.execute();
checkResult(result, new Node[]{foo, bla});
}
> 'OR' in XPath query badly interpreted
> -------------------------------------
>
> Key: JCR-562
> URL: http://issues.apache.org/jira/browse/JCR-562
> Project: Jackrabbit
> Issue Type: Bug
> Components: core
> Affects Versions: 1.0.1
> Reporter: Szymon Kuzniak
> Attachments: JCR-562.patch, tree.JPG
>
>
> executing query: //*[@a=1 and @b=2 or @c=3] leads to creating wrong query tree. The builded tree looks like for query: //*[@a=1 and @b=2 and @c=3](see attachement). using brackets resolves the problem, but without brackets output query is different from input query. When AND and OR are switched(so the OR is in first palce - //*[@a=1 or @b=2 and @c=3]) everything is ok.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira