orientdb icon indicating copy to clipboard operation
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

Open giastfader opened this issue 13 years ago • 0 comments

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

giastfader avatar Jan 30 '13 15:01 giastfader