maedhroz commented on code in PR #1962:
URL: https://github.com/apache/cassandra/pull/1962#discussion_r1041520301


##########
src/java/org/apache/cassandra/cql3/Operation.java:
##########
@@ -365,17 +389,23 @@ public Substraction(Term.Raw value)
         }
 
         public Operation prepare(TableMetadata metadata, ColumnMetadata 
receiver, boolean canReadExistingState) throws InvalidRequestException
-        {
+        {   
             if (!(receiver.type instanceof CollectionType))
             {
-                if (!(receiver.type instanceof CounterColumnType))
+                if (canReadExistingState)
+                {
+                    if (!(receiver.type instanceof NumberType))

Review Comment:
   Pulling up to the outer `if` slightly changes the behavior though. If the 
inner `if` fails, you need to fall through to `return`.



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