smiklosovic commented on code in PR #4115: URL: https://github.com/apache/cassandra/pull/4115#discussion_r2058681086
########## src/java/org/apache/cassandra/cql3/constraints/ScalarColumnConstraint.java: ########## @@ -125,11 +127,18 @@ protected void internalEvaluate(AbstractType<?> valueType, ByteBuffer columnValu @Override public void validate(ColumnMetadata columnMetadata) throws InvalidConstraintDefinitionException { + returnType = columnMetadata.type; + + if (!columnMetadata.name.equals(columnName)) + throw new InvalidConstraintDefinitionException(String.format("Parameter of %s constraint should be the column name (%s)", + name(), + columnMetadata.name)); + validateTypes(columnMetadata); try { - value = columnMetadata.type.fromString(ParseUtils.unquote(term)); + value = returnType.fromString(ParseUtils.unquote(term)); Review Comment: not related to this PR directly but we might "cache" unquoted `term` so we don't do it all over again every time -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org