zstan commented on code in PR #5145:
URL: https://github.com/apache/ignite-3/pull/5145#discussion_r1939395988
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/TypeUtils.java:
##########
@@ -735,6 +743,15 @@ public static <RowT> RowT
validateCharactersOverflowAndTrimIfPossible(
RelDataType colType = rowType.getFieldList().get(i).getType();
Object data = rowHandler.get(i, row);
+ if (BINARY_TYPES.contains(colType.getSqlTypeName()) && data !=
null) {
+ assert data instanceof ByteString;
+ assert colType.getPrecision() !=
RelDataType.PRECISION_NOT_SPECIFIED;
+
+ if (((ByteString) data).length() > colType.getPrecision()) {
+ throw new SqlException(STMT_VALIDATION_ERR, format("Value
too long for type binary({})", colType.getPrecision()));
Review Comment:
We have no real column type here, thus in test
"testErrorIfBinaryValueSizeGtThanTypePrecision" for BINARY and VARBINARY the
same column type: VARBINARY will return, seems it can`t be easily fixed
--
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]