You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "alanwang67 (via GitHub)" <gi...@apache.org> on 2026/08/28 00:08:18 UTC
[PR] CASSANDRA-21625 Column Comparison with null NPEs for Accord Transaction [cassandra]
alanwang67 opened a new pull request, #5073:
URL: https://github.com/apache/cassandra/pull/5073
The following transaction NPEs, we should instead reject transactions that compare a column with null. IS NULL/IS NOT NULL should be used instead.
```
BEGIN TRANSACTION
LET row1 = (SELECT * FROM distributed_test_keyspace.accordtbl0 WHERE k=1);
IF row1.v = null THEN
UPDATE distributed_test_keyspace.accordtbl0 SET v=1 WHERE k=1;
END IF
COMMIT TRANSACTION
```
patch by Alan Wang;
reviewed by for [CASSANDRA-21625](https://issues.apache.org/jira/browse/CASSANDRA-21625)
Co-authored-by: Name1
Co-authored-by: Name2
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21625 Column Comparison with null NPEs for Accord Transaction [cassandra]
Posted by "dcapwell (via GitHub)" <gi...@apache.org>.
dcapwell commented on code in PR #5073:
URL: https://github.com/apache/cassandra/pull/5073#discussion_r3878003284
##########
src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:
##########
@@ -498,6 +498,7 @@ public Value(TxnReference.ColumnReference reference, Kind kind, ByteBuffer value
{
super(kind);
Invariants.requireArgument(KINDS.contains(kind), "Kind " + kind + " cannot be used with a value condition");
+ Invariants.requireArgument(value != null, "Value conditions require a non null comparison value");
Review Comment:
it might be best to do something like `value = reference.type().santize(value)` or check `isNull` here... that is just to handle "meaningless emptyness" (legacy concept from thrift days, but it impacts many common types like `int`)
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org