zstan commented on code in PR #5145:
URL: https://github.com/apache/ignite-3/pull/5145#discussion_r1942344411


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/TypeUtils.java:
##########
@@ -715,16 +717,22 @@ private static TypeSpec convertToTypeSpec(RelDataType 
type) {
      *  <br>
      *  2) If one or more of the rightmost M-L characters of V are not 
space(s), then an
      *   exception condition is raised: data exception — string data, right 
truncation.
+     *  <br>
+     *  3) If the declared type of T is binary string and the length in octets 
of V is greater than the
+     *   maximum length in octets L of T, then the value of T is set to the 
first L octets of V, the
+     *   length in octets of T becomes L, and a completion condition is 
raised: warning — string
+     *   data, right truncation.
      */
-    public static <RowT> RowT validateCharactersOverflowAndTrimIfPossible(
+    public static <RowT> RowT validateStringTypesOverflowAndTrimIfPossible(

Review Comment:
   done



##########
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java:
##########
@@ -629,18 +630,17 @@ private static Stream<Arguments> 
decimalOverflowsValidation() {
     }
 
     @Test
-    @SuppressWarnings("ThrowableNotThrown")
     public void testCharTypesWithTrailingSpacesAreTrimmed() {
-        sql("create table limitedChar (pk int primary key, f1 VARCHAR(3))");
+        sql("create table limitedChar (pk int primary key, fb1 VARBINARY(2), 
f1 VARCHAR(3), fb2 VARBINARY(1))");
 
         try {
-            sql("insert into limitedChar values (1, 'a b     ')");
+            sql("insert into limitedChar values (1, x'01', 'a b     ', 
x'01')");
 
             assertQuery("select length(f1) from limitedChar")
                     .returns(3)
                     .check();
 
-            sql("insert into limitedChar values (2, 'a ' || ?)", "b     ");
+            sql("insert into limitedChar values (2, x'01', 'a ' || ?, x'01')", 
"b     ");

Review Comment:
   revert



-- 
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]

Reply via email to