omniCoder77 commented on code in PR #4596:
URL: https://github.com/apache/cassandra/pull/4596#discussion_r2772555029
##########
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:
##########
@@ -409,7 +409,21 @@ public void validate(ClientState state) throws
InvalidRequestException
checkFalse(isVirtual() && hasConditions(), "Conditional updates are
not supported by virtual tables");
if (attrs.isTimestampSet())
+ {
Guardrails.userTimestampsEnabled.ensureEnabled(state);
+ }
+ // Misprepare guardrail shouldn't block system keyspaces
+ if (SchemaConstants.isSystemKeyspace(metadata.keyspace))
+ return;
+
+ boolean hasRestriction = restrictions != null &&
+ restrictions.hasPartitionKeyRestrictions() ||
+
restrictions.hasClusteringColumnsRestrictions() ||
+ restrictions.hasNonPrimaryKeyRestrictions();
+ if (getBindVariables().isEmpty() && hasRestriction)
+ {
+ Guardrails.onMisprepared(state);
Review Comment:
```
public static void onMisprepared(ClientState state)
{
mispreparedStatementsEnabled.ensureEnabled(state);
mispreparedStatementsEnabled.warn(MISPREPARED_STATEMENT_WARN_MESSAGE);
}
```
here warn is a protected function, can't write it inside statement classes
or interface, not sure where else to put it.
--
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]