thomasmueller commented on code in PR #3250:
URL: https://github.com/apache/jackrabbit-oak/pull/3250#discussion_r4440854610
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java:
##########
@@ -97,6 +97,15 @@ public void restrict(FilterImpl f, Operator operator,
PropertyValue v) {
return;
}
String name = getName(query, v);
+ if (name == null && supportedOperator(operator) &&
v.getValue(Type.STRING).isEmpty()
+ && !f.testPath("/") && f.getSelector().equals(selector)
+ && query.getSettings().isEmptyNodeNameRestrictionEnabled()) {
+ // Only the root has an empty name; use an impossible name when it
is excluded.
+ PropertyValue impossibleName = PropertyValues.newString(":");
+ f.restrictProperty(QueryConstants.RESTRICTION_LOCAL_NAME,
Operator.EQUAL, impossibleName);
+ f.restrictProperty(QueryConstants.FUNCTION_RESTRICTION_PREFIX +
getFunction(f.getSelector()),
+ Operator.EQUAL, impossibleName, PropertyType.STRING);
+ }
Review Comment:
You are right! I didn't think about this. Should be fixed now.
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineSettings.java:
##########
@@ -73,6 +73,9 @@ public class QueryEngineSettings implements
QueryEngineSettingsMBean, QueryLimit
public static final String FT_XML_NAME_CHARS_IN_PATH = "FT_OAK-12364";
+ public static final String FT_EMPTY_NODE_NAME_RESTRICTION_LEGACY_MODE =
+ "FT_EMPTY_NODE_NAME_RESTRICTION_LEGACY_MODE";
Review Comment:
Renamed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]