You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "David Capwell (Jira)" <ji...@apache.org> on 2025/03/24 17:24:00 UTC

[jira] [Created] (CASSANDRA-20477) Add support in CAS for -= on numeric types, and fixed improper handling of empty bytes which lead to NPE

David Capwell created CASSANDRA-20477:
-----------------------------------------

             Summary: Add support in CAS for -= on numeric types, and fixed improper handling of empty bytes which lead to NPE
                 Key: CASSANDRA-20477
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20477
             Project: Apache Cassandra
          Issue Type: New Feature
          Components: Feature/Lightweight Transactions, Test/fuzz
            Reporter: David Capwell
            Assignee: David Capwell


CAS supports += on numeric types but -= was only supported for counters!  Should add support so this logic is symmetrical.

Existing += logic would also generate a NPE if you wrote to a row with empty bytes or you try to increment using empty bytes.

{code}
ERROR [node1_Native-Transport-Requests-1] node1 2025-03-21 15:29:01,882 ErrorMessage.java:457 - Unexpected exception during request
java.lang.NullPointerException: null
	at org.apache.cassandra.db.marshal.IntegerType.toBigInteger(IntegerType.java:520)
	at org.apache.cassandra.db.marshal.IntegerType.add(IntegerType.java:525)
	at org.apache.cassandra.cql3.terms.Constants$Adder.execute(Constants.java:496)
{code}

In making these changes we should also update the existing AST Harry model to support CAS operations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org