ygerzhedovich commented on code in PR #3782:
URL: https://github.com/apache/ignite-3/pull/3782#discussion_r1608049048


##########
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java:
##########
@@ -655,6 +656,65 @@ public void charLimitationWithMergeUpdateOp() {
         }
     }
 
+    @Test
+    public void zeroStringsAreNotAllowed() {
+        // Char
+
+        assertThrowsSqlException(
+                STMT_VALIDATION_ERR,
+                "Length for type CHAR must be at least 1",
+                () -> sql("SELECT CAST(1 AS CHAR(0))")
+        );
+
+        assertThrowsSqlException(
+                STMT_VALIDATION_ERR,
+                "Length for type CHAR must be at least 1",
+                () -> sql("SELECT '1'::CHAR(0)")
+        );
+
+        // Varchar
+
+        assertThrowsSqlException(
+                STMT_VALIDATION_ERR,
+                "Length for type VARCHAR must be at least 1",
+                () -> sql("SELECT CAST(1 AS VARCHAR(0))")
+        );
+
+        assertThrowsSqlException(
+                STMT_VALIDATION_ERR,
+                "Length for type VARCHAR must be at least 1",
+                () -> sql("SELECT '1'::VARCHAR(0)")
+        );
+
+        // Binary
+
+        assertThrowsSqlException(
+                STMT_VALIDATION_ERR,
+                "Length for type BINARY must be at least 1",

Review Comment:
   I mean '.....must be at least 1' and '.....must be positive'



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to