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


##########
modules/sql-engine/src/integrationTest/sql/types/char/test_char_length.test:
##########
@@ -0,0 +1,65 @@
+# name: test/sql/types/char/test_char_length.test
+# description: E021-01 Character string types. CHARACTER data type. Check 
length of the CHAR datatype.
+# group: [char]
+
+# length shouldn't be negative;
+statement error
+CREATE TABLE t_negative(c1 CHAR(-1));
+
+# length shouldn't be zero;
+skipif ignite3
+statement ok
+CREATE TABLE t_zero(c1 CHAR(0));
+
+statement ok
+CREATE TABLE t_default(c1 CHAR);
+
+# If <length> is omitted, then a <length> of 1 (one) is implicit.
+skipif ignite3
+# https://issues.apache.org/jira/browse/IGNITE-18492
+statement error
+INSERT INTO t_default VALUES('12');
+
+statement ok
+INSERT INTO t_default VALUES('1');
+
+# possibility to insert empty string
+statement ok
+INSERT INTO t_default VALUES('');
+
+
+statement ok
+CREATE TABLE t_three (c1 CHAR(3), c2 CHARACTER(3));
+
+# MUST FAIL due to length
+skipif ignite3
+# https://issues.apache.org/jira/browse/IGNITE-18492
+statement error
+INSERT INTO t_three VALUES('1', '4444');
+
+# MUST FAIL due to length
+skipif ignite3
+# https://issues.apache.org/jira/browse/IGNITE-18492
+statement error
+INSERT INTO t_three VALUES('1234', '444');
+
+statement ok
+INSERT INTO t_three VALUES('123', '456'), ('1  ', '1'), (' 2 ', '2'), ('  
3','3');

Review Comment:
   did we have appropriate issue if we change this test for insertion not 3 but 
more white space consistent strings ?  seems we need such a case to be appended 
here ?
   for example :
   ```
   INSERT INTO t_three VALUES('     3     ', '     4          ');
   SELECT LENGTH(c1), LENGTH(c2) FROM t_three;
   ----
   3    1
   ```



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