You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2012/07/05 14:54:33 UTC

[jira] [Created] (JCR-3376) TCK: SQLPathTest.testChildAxisRoot expected root node not in result

Thomas Mueller created JCR-3376:
-----------------------------------

             Summary: TCK: SQLPathTest.testChildAxisRoot expected root node not in result
                 Key: JCR-3376
                 URL: https://issues.apache.org/jira/browse/JCR-3376
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
            Reporter: Thomas Mueller
            Assignee: Thomas Mueller
            Priority: Minor


The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:

    SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'

It expected the result to be

    /jcr:system, /testroot, /testdata

It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:

"
Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):

	"As in SQL, the character '%' represents any string of zero or more 
	characters, and the character '_' (underscore) represents any 
	single character."

while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:

	"Predicates in the WHERE clause that test jcr:path are only required to 
	support the operators =, <> and LIKE. In the case of LIKE predicates, 
	support is only required for tests using the % wildcard character as a 
	match for a whole path segment (the part between two / characters) 
	or within index brackets...."

Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
"

the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.

To allow an implementation to return the root node, I suggest to change the test as follows:

... AND NOT jcr:path LIKE '/%/%' AND jcr:path <> '/'



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (JCR-3376) TCK: SQLPathTest.testChildAxisRoot expects root node not in result

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved JCR-3376.
---------------------------------

    Resolution: Fixed

Revision 1359213 allows for optional nodes to be in the result. For the test SQLPathTest.testChildAxisRoot, the root node is now optional.

I tested with Jackrabbit Core (-PintegrationTesting) and with Oak (oak-jcr), with the test removed from the known.issues list in the pom.xml.
                
> TCK: SQLPathTest.testChildAxisRoot expects root node not in result
> ------------------------------------------------------------------
>
>                 Key: JCR-3376
>                 URL: https://issues.apache.org/jira/browse/JCR-3376
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 2.6
>
>
> The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:
>     SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'
> It expects the result to be
>     /jcr:system, /testroot, /testdata
> It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:
> "
> Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):
> 	"As in SQL, the character '%' represents any string of zero or more 
> 	characters, and the character '_' (underscore) represents any 
> 	single character."
> while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:
> 	"Predicates in the WHERE clause that test jcr:path are only required to 
> 	support the operators =, <> and LIKE. In the case of LIKE predicates, 
> 	support is only required for tests using the % wildcard character as a 
> 	match for a whole path segment (the part between two / characters) 
> 	or within index brackets...."
> Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
> "
> the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3376) TCK: SQLPathTest.testChildAxisRoot expects root node not in result

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller updated JCR-3376:
--------------------------------

    Description: 
The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:

    SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'

It expects the result to be

    /jcr:system, /testroot, /testdata

It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:

"
Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):

	"As in SQL, the character '%' represents any string of zero or more 
	characters, and the character '_' (underscore) represents any 
	single character."

while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:

	"Predicates in the WHERE clause that test jcr:path are only required to 
	support the operators =, <> and LIKE. In the case of LIKE predicates, 
	support is only required for tests using the % wildcard character as a 
	match for a whole path segment (the part between two / characters) 
	or within index brackets...."

Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
"

the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.




  was:
The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:

    SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'

It expected the result to be

    /jcr:system, /testroot, /testdata

It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:

"
Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):

	"As in SQL, the character '%' represents any string of zero or more 
	characters, and the character '_' (underscore) represents any 
	single character."

while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:

	"Predicates in the WHERE clause that test jcr:path are only required to 
	support the operators =, <> and LIKE. In the case of LIKE predicates, 
	support is only required for tests using the % wildcard character as a 
	match for a whole path segment (the part between two / characters) 
	or within index brackets...."

Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
"

the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.

To allow an implementation to return the root node, I suggest to change the test as follows:

... AND NOT jcr:path LIKE '/%/%' AND jcr:path <> '/'



        Summary: TCK: SQLPathTest.testChildAxisRoot expects root node not in result  (was: TCK: SQLPathTest.testChildAxisRoot expected root node not in result)
    
> TCK: SQLPathTest.testChildAxisRoot expects root node not in result
> ------------------------------------------------------------------
>
>                 Key: JCR-3376
>                 URL: https://issues.apache.org/jira/browse/JCR-3376
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 2.6
>
>
> The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:
>     SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'
> It expects the result to be
>     /jcr:system, /testroot, /testdata
> It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:
> "
> Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):
> 	"As in SQL, the character '%' represents any string of zero or more 
> 	characters, and the character '_' (underscore) represents any 
> 	single character."
> while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:
> 	"Predicates in the WHERE clause that test jcr:path are only required to 
> 	support the operators =, <> and LIKE. In the case of LIKE predicates, 
> 	support is only required for tests using the % wildcard character as a 
> 	match for a whole path segment (the part between two / characters) 
> 	or within index brackets...."
> Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
> "
> the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3376) TCK: SQLPathTest.testChildAxisRoot expected root node not in result

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409317#comment-13409317 ] 

Thomas Mueller commented on JCR-3376:
-------------------------------------

Thanks Jukka! I didn't consider the possibility of such a limitation and so didn't run the Jackrabbit test. I will try to find an alternative solution.
                
> TCK: SQLPathTest.testChildAxisRoot expected root node not in result
> -------------------------------------------------------------------
>
>                 Key: JCR-3376
>                 URL: https://issues.apache.org/jira/browse/JCR-3376
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 2.6
>
>
> The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:
>     SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'
> It expected the result to be
>     /jcr:system, /testroot, /testdata
> It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:
> "
> Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):
> 	"As in SQL, the character '%' represents any string of zero or more 
> 	characters, and the character '_' (underscore) represents any 
> 	single character."
> while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:
> 	"Predicates in the WHERE clause that test jcr:path are only required to 
> 	support the operators =, <> and LIKE. In the case of LIKE predicates, 
> 	support is only required for tests using the % wildcard character as a 
> 	match for a whole path segment (the part between two / characters) 
> 	or within index brackets...."
> Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
> "
> the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.
> To allow an implementation to return the root node, I suggest to change the test as follows:
> ... AND NOT jcr:path LIKE '/%/%' AND jcr:path <> '/'

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (JCR-3376) TCK: SQLPathTest.testChildAxisRoot expected root node not in result

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting reopened JCR-3376:
--------------------------------


Revision 1357596 broke the Jackrabbit build since the query engine rejects two jcr:path constraints in one query.

It sounds like we should rather fix Jackrabbit than this test case, but until someone has time to look at the details it's best to avoid failing the build, so I reverted the change for now in revision 1358567. Reopening until we have a better solution.
                
> TCK: SQLPathTest.testChildAxisRoot expected root node not in result
> -------------------------------------------------------------------
>
>                 Key: JCR-3376
>                 URL: https://issues.apache.org/jira/browse/JCR-3376
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 2.6
>
>
> The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:
>     SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'
> It expected the result to be
>     /jcr:system, /testroot, /testdata
> It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:
> "
> Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):
> 	"As in SQL, the character '%' represents any string of zero or more 
> 	characters, and the character '_' (underscore) represents any 
> 	single character."
> while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:
> 	"Predicates in the WHERE clause that test jcr:path are only required to 
> 	support the operators =, <> and LIKE. In the case of LIKE predicates, 
> 	support is only required for tests using the % wildcard character as a 
> 	match for a whole path segment (the part between two / characters) 
> 	or within index brackets...."
> Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
> "
> the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.
> To allow an implementation to return the root node, I suggest to change the test as follows:
> ... AND NOT jcr:path LIKE '/%/%' AND jcr:path <> '/'

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (JCR-3376) TCK: SQLPathTest.testChildAxisRoot expected root node not in result

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved JCR-3376.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.6
    
> TCK: SQLPathTest.testChildAxisRoot expected root node not in result
> -------------------------------------------------------------------
>
>                 Key: JCR-3376
>                 URL: https://issues.apache.org/jira/browse/JCR-3376
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 2.6
>
>
> The TCK test SQLPathTest.testChildAxisRoot runs the following SQL-1 query:
>     SELECT * FROM nt:base WHERE jcr:path LIKE '/%' AND NOT jcr:path LIKE '/%/%'
> It expected the result to be
>     /jcr:system, /testroot, /testdata
> It does not allow the implementation to return the root node ('/'). According to the specification, a JCR implementation may filter the root node, as noted by Randall Hauch - http://jackrabbit.510166.n4.nabble.com/TCK-SQLPathTest-testChildAxisRoot-td4655670.html - quote:
> "
> Section 6.6.5.1 ("jcr:like function") defines the semantics of the wildcard characters as generally used within LIKE predicates (and "jcr:like" in XPath):
> 	"As in SQL, the character '%' represents any string of zero or more 
> 	characters, and the character '_' (underscore) represents any 
> 	single character."
> while Section 8.5.2.2 ("Pseudo-property jcr:path") specifies the semantics "jcr:path" pseudo column and narrows the semantics of using LIKE with "jcr:path" in the second-to-last bullet point:
> 	"Predicates in the WHERE clause that test jcr:path are only required to 
> 	support the operators =, <> and LIKE. In the case of LIKE predicates, 
> 	support is only required for tests using the % wildcard character as a 
> 	match for a whole path segment (the part between two / characters) 
> 	or within index brackets...."
> Because the '%' matches only a whole path segment, the "/%" literal only matches paths that have at least one path segment, which means that it matches all descendants of the root node.
> "
> the specification says "In the case of LIKE predicates, support is only required for tests using the % wildcard character as a match for a whole path segment (the part between two / characters)..." but it doesn't specify it needs to do so.
> To allow an implementation to return the root node, I suggest to change the test as follows:
> ... AND NOT jcr:path LIKE '/%/%' AND jcr:path <> '/'

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira