smiklosovic commented on code in PR #4596:
URL: https://github.com/apache/cassandra/pull/4596#discussion_r2752207420


##########
src/java/org/apache/cassandra/cql3/QueryProcessor.java:
##########
@@ -513,6 +529,56 @@ public static Prepared parseAndPrepare(String query, 
ClientState clientState, bo
         return res;
     }
 
+    private static void checkMispreparedGuardrail(CQLStatement statement, 
ClientState clientState)
+    {
+        AuthenticatedUser user = clientState.getUser();
+        if (user != null && user.isSuper())
+            return;
+
+        if (Guardrails.mispreparedStatementsEnabled.enabled(clientState))

Review Comment:
   is not the logic here actually the other way around? if it is enabled then 
we are going to just warn, if it is disabled (false in yaml), then we fail, 
"use_misprepared_statements" set to "false" means that we CAN NOT use them, so 
we need to fail in that situation. If it is true then we just warn.
   
   You also do not need to use "NoSpamLogger.log". Check what Guardrail.warn is 
doing (EnableFlag subclass of Guardrail so you can call .warn() here too). That 
already warns in a non-spamming manner and does other things (diagnostic events 
etc). 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to