jrwest commented on code in PR #3355:
URL: https://github.com/apache/cassandra/pull/3355#discussion_r1669421736
##########
src/java/org/apache/cassandra/cql3/UpdateParameters.java:
##########
@@ -163,8 +163,28 @@ public Cell<?> addCell(ColumnMetadata column, ByteBuffer
value) throws InvalidRe
public Cell<?> addCell(ColumnMetadata column, CellPath path, ByteBuffer
value) throws InvalidRequestException
{
+ // General column value size
Guardrails.columnValueSize.guard(value.remaining(),
column.name.toString(), false, clientState);
+ if (column.type.asCQL3Type() == CQL3Type.Native.ASCII) // Ascii size
specific guardrail
Review Comment:
Why not a switch statement here? if not, no need for the else's with the
nested ifs, it makes it more verbose -- use else if instead. Also think moving
this to a `validateSize` function (or something similarly named) would make it
more clear
--
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]