Skip to content

Conversation

@Dekrate
Copy link

@Dekrate Dekrate commented Oct 23, 2025

Restrict BytesType compatibility to scalar types only

BytesType.isValueCompatibleWith() previously accepted all types,
including frozen collections and UDTs. This was incorrect because
converting collections or UDTs to raw bytes is nonsensical - it
allows reading raw serialized bytes which have no meaningful
interpretation.

This patch restricts BytesType to only accept simple scalar types
by checking !isCollection() && !isUDT() in isValueCompatibleWithInternal().

@driftx <- it was your task, I was happy to help!

BytesType.isValueCompatibleWith() previously accepted all types,
including frozen collections and UDTs. This was incorrect because
converting collections or UDTs to raw bytes is nonsensical - it
allows reading raw serialized bytes which have no meaningful
interpretation.

This patch restricts BytesType to only accept simple scalar types
by checking !isCollection() && !isUDT() in isValueCompatibleWithInternal().

patch by Dekrate for CASSANDRA-20982
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.

1 participant