Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
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.