Is this expected...
VMart=> create table VARCHAR_TEST (X VARCHAR2(32));
CREATE TABLE
VMart=> insert into VARCHAR_TEST values (REPEAT('A',32));
OUTPUT
--------
1
(1 row)
VMart=> insert into VARCHAR_TEST values (REPEAT('A',33));
ERROR 8682: String of 33 octets is too long for type Varchar(32) for column X
VMart=> insert into VARCHAR_TEST values (REPEAT(' ',33));
OUTPUT
--------
1
(1 row)
VMart=> SELECT X, LENGTH(x), NVL2(X,'NOT-NULL',NULL) from VARCHAR_TEST
VMart-> ;
X | LENGTH | NVL2
----------------------------------+--------+----------
| 32 | NOT-NULL
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | 32 | NOT-NULL
(2 rows)
I was not allowed to insert 33 'A's into VARCHAR_TEST - Expected
I was allowed to insert 33 'SPACE' characters into VARCHAR_TEST - Unexpected
I ended up with 32 Space characters - sort of exected in the previous behavoir is correct...
But why trim a string of whitespace but throw on a string of non-whitepace.
NB Oracle and Postgres both reject a string of 33 space characters..
Before anyone asks, I am try to reconcile differences in behavior observed when porting YADAMU's corner case test suite for YADAMU from Oracle, Postgres, SQLServer, DB2, MySQL, Snowflake to Vetica