Value error for a wrong datatype

here’s my example
create table test1 (data_1 INT);
insert into test1 values (‘data is more than 1 character’);

it inserts a 0 and does not give me a datatype mismatch error
How do I catch this??

create table test2 (data_1 VARCHAR(1));
insert into test2 values (‘data is more than 1 character’);

it inserts a ‘d’ and truncates rest but no error at all
How do I catch this??

Hi,

The error handling behavior for data conversions can be changed via the data_conversion_compatibility_level system variable. There is a bit more info about what it does here:

If your running MemSQL 6.5,6,7 or 6.8 then run this on your master aggregator:
SET GLOBAL data_conversion_compatibility_level = '6.5'

If your running MemSQL 7, set it to ‘7.0’ instead.