[
https://issues.apache.org/jira/browse/OAK-12494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Mueller updated OAK-12494:
---------------------------------
Description:
A query with a "name()=''" restriction ignores this restriction.
The root node is the only node with an empty name.
We can use this knowledge instead of dropping the restriction (which will allow
too many results).
Example:
{noformat}
SELECT * FROM [nt:base] WHERE NAME() = ''
=> only the root node
SELECT * FROM [nt:base] WHERE NAME() = '' AND ISDESCENDANTNODE('/')
=> can not have any results, because ISDESCENDANTNODE excludes the root node
{noformat}
Same for LOCALNAME().
was:
A query with a "name()=''" restriction ignores this restriction.
It is not allowed to have such names, but instead of dropping the restriction
(which will allow too many results), the restriction should be used to mean "no
entries", specially if there is a function-based index on "name()".
Example:
{noformat}
SELECT * FROM [nt:base] WHERE NAME() = ''
{noformat}
> Index usage of NAME()='' (with empty value)
> -------------------------------------------
>
> Key: OAK-12494
> URL: https://issues.apache.org/jira/browse/OAK-12494
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Reporter: Thomas Mueller
> Assignee: Thomas Mueller
> Priority: Major
>
> A query with a "name()=''" restriction ignores this restriction.
> The root node is the only node with an empty name.
> We can use this knowledge instead of dropping the restriction (which will
> allow too many results).
> Example:
> {noformat}
> SELECT * FROM [nt:base] WHERE NAME() = ''
> => only the root node
> SELECT * FROM [nt:base] WHERE NAME() = '' AND ISDESCENDANTNODE('/')
> => can not have any results, because ISDESCENDANTNODE excludes the root node
> {noformat}
> Same for LOCALNAME().
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)