dcapwell commented on code in PR #4006:
URL: https://github.com/apache/cassandra/pull/4006#discussion_r2010648526
##########
src/java/org/apache/cassandra/cql3/terms/Constants.java:
##########
@@ -489,8 +489,10 @@ public void execute(DecoratedKey partitionKey,
UpdateParameters params) throws I
else if (column.type instanceof NumberType<?>)
{
@SuppressWarnings("unchecked") NumberType<Number> type =
(NumberType<Number>) column.type;
- ByteBuffer increment = t.bindAndGet(params.options);
- ByteBuffer current = getCurrentCellBuffer(partitionKey,
params);
+ ByteBuffer increment =
type.sanitize(t.bindAndGet(params.options));
Review Comment:
`type.sanitize` is a bug fix for empty bytes. Numeric types allow `byte[0]`
and its semantic is weird... in 90% of the codebase its `null` but in that 10%
its not... this code path hits a NPE as its part of the 90%...
empty is only not null if and only if you do `col = <empty>`, any other path
its `null`... which includes this path now (else we NPE)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]