Skip to content

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
apache:trunkfrom
minal-kyada:paxos-lwt-cas-emptyvaluemeaningless-fix
Open

CASSANDRA-21505: CAS EQ/NEQ incorrectly distinguishes null from meaningless empty bytes for fixed-length types due to missing sanitization#5010
minal-kyada wants to merge 2 commits into
apache:trunkfrom
minal-kyada:paxos-lwt-cas-emptyvaluemeaningless-fix

Conversation

@minal-kyada

Copy link
Copy Markdown
Contributor

Thanks for sending a pull request! Here are some tips if you're new here:

  • Ensure you have added or run the appropriate tests for your PR.
  • Be sure to keep the PR description updated to reflect all changes.
  • Write your PR title to summarize what this PR proposes.
  • If possible, provide a concise example to reproduce the issue for a faster review.
  • Read our contributor guidelines
  • If you're making a documentation change, see our guide to documentation contribution

Commit messages should follow the following format:

<One sentence description, usually Jira title or CHANGES.txt summary>

<Optional lengthier description (context on patch)>

patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####

Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>

The Cassandra Jira

@minal-kyada
minal-kyada force-pushed the paxos-lwt-cas-emptyvaluemeaningless-fix branch from bd46d77 to d3317e2 Compare August 14, 2026 20:57
@minal-kyada minal-kyada changed the title Added isEmptyValueMeaningless support for LWT/CAS CASSANDRA-21505: CAS EQ/NEQ incorrectly distinguishes null from meaningless empty bytes for fixed-length types due to missing sanitization 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())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants