CASSANDRA-21505: CAS EQ/NEQ incorrectly distinguishes null from meaningless empty bytes for fixed-length types due to missing sanitization - #5010
Open
minal-kyada wants to merge 2 commits into
Conversation
minal-kyada
force-pushed
the
paxos-lwt-cas-emptyvaluemeaningless-fix
branch
from
August 14, 2026 20:57
bd46d77 to
d3317e2
Compare
dcapwell
reviewed
Aug 14, 2026
| if (bb != null && symbol.type().isNull(bb)) | ||
| // isEmptyValueMeaningless types store empty bytes as a distinct value from null; | ||
| // preserve it for CAS raw-byte comparison | ||
| if (bb != null && symbol.type().isNull(bb) && !symbol.type().isEmptyValueMeaningless()) |
Contributor
There was a problem hiding this comment.
this patch doesn't really make sense to me.
CAS IF with equality operators are the only place we need to special case where byte[0] != null, as the rest of the code (which goes through this code path) require byte[0] == null (we are only talking about meaningless emptyness).
So to fix CAS IF we need to break the rest of the CQL surface?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira