orientdb
orientdb copied to clipboard
[1.3.0 Snapshot build 16] OrientDB does not throw an exception if an arbitrary string is inserted in a boolean field
Hi, look at this code: create class post; create property post.published boolean; insert into post (text,published) values ("I am a text","am I a boolean?");
OrientDB replies with: Inserted record 'post#11:0{text:I am a text,published:null} v0' in 0,001000 sec(s).
Since the string cannot be converted in a boolean, a null value is inserted.
I was expecting an error. In fact with other field types, an exception is thrown:
create property post.pubDate date; insert into post (text,pubDate ) values ("I am a text, again!","am I a date?"); Error: com.orientechnologies.orient.core.exception.OQueryParsingException: Error on conversion of date 'am I a date?' using the format: yyyy-MM-dd HH:mm:ss