thomasmueller commented on code in PR #1094:
URL: https://github.com/apache/jackrabbit-oak/pull/1094#discussion_r1317041436


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java:
##########
@@ -234,6 +249,28 @@ public Query parse(final String query, final boolean 
initialise) throws ParseExc
 
         return q;
     }
+
+    /**
+     * Checks the InsecureQueryOptionsMode for the values ALLOW or DENY. If 
allowed, the method returns true,
+     * indicating that insecure options should be returned by the parser. If 
denied, a ParseException is thrown.
+     * For all other modes, the method returns false, indicating that this 
option should be ignored.
+     *
+     * @return true if the mode is ALLOW, false otherwise
+     * @throws ParseException if the mode is DENY
+     */
+    private boolean allowsInsecureOptions() throws ParseException {

Review Comment:
   I think checking (and throwing the exception) need to happen at execution 
time, not while parsing.



##########
oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryOptions.java:
##########
@@ -106,6 +110,14 @@ public QueryOptions(QueryOptions defaultValues) {
             t.read(']');
             prefetch = list;
         }
+        x = map.get("insecureResultSize");
+        if (x != null) {

Review Comment:
   I think the following should work:
   
       insecureResultSize = Boolean.parseBoolean(map.get("insecureResultSize"))



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to