smiklosovic commented on code in PR #4596:
URL: https://github.com/apache/cassandra/pull/4596#discussion_r2772129142
##########
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:
I would rather just copy the content of that mehod here instead of having
completely arbitrary method in Guardrails. There is no precedent to that.
You might also move it to superclass of these Statement classes so both can
call 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]