Hello, seems sql standard regulate situation when insertion (char, varchar) data exceeds fixed len column as :

If the declared type T is fixed length string with length in characters L and the
length in characters M of V is larger than L, then
Case:
a) If the right part M–L characters of V are all space`s, then the value of T is set to the first
L characters of V.
b) If one or more of the right part M–L characters of V are not space`s, then exception is raised.

But fast test [1] in SqlToRelConverterTest highlights that calcite not satisfy of such a rule.

I miss something or need to fill the issue ?

Thanks !


[1]
  @Test void testInsert1() {
    String moreThanVarcharLimit = "a".repeat(30);

final String sql = "insert into emp (empno, ename, job, mgr, hiredate,\n"
        + "  sal, comm, deptno, slacker)\n"
        + "values(1, '" + moreThanVarcharLimit + "', 'job', 0,\n"
        + "  timestamp '1970-01-01 00:00:00', 1, 1, 1, false)";
    sql(sql).ok();
  }

Reply via email to