zstan commented on code in PR #5145:
URL: https://github.com/apache/ignite-3/pull/5145#discussion_r1940549859
##########
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()));
+ }
+ }
+
// Skip null values and non-character types.
if (!CHAR_TYPES.contains(colType.getSqlTypeName()) || data ==
null) {
Review Comment:
done
--
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]