Hello,
I've defined a simple class that has got a DATETIME property and I've inserted some data (below you can find the console script I run):
CREATE DATABASE remote:localhost:2426/datetime-precision-test root pippo local graph;
CREATE CLASS TestClass EXTENDS OGraphVertex;
CREATE PROPERTY TestClass.Issuer STRING;
CREATE PROPERTY TestClass.IssueInstant DATETIME;
CREATE PROPERTY TestClass.ID STRING;
CREATE PROPERTY TestClass.resourceID STRING;
INSERT INTO TestClass (Issuer, IssueInstant, ID, resourceID) VALUES ('pi...@cartoonia.com', '2012-05-14 13:41:23:214', 'adafq3wr367364rfbeq', 'http://www.iot-at-work.eu/resourceA');
INSERT INTO TestClass (Issuer, IssueInstant, ID, resourceID) VALUES ('pi...@cartoonia.com', '2012-05-14 13:41:23:147', 'f243erd3wr367364rfb', 'http://www.iot-at-work.eu/resourceB');
In order to test whether millisecond precision works in SQL WHERE clause
, I've executed the queries below that select nothing:
select from TestClass where IssueInstant = date( '2012-05-14 13:41:23:214', 'yyyy-MM-dd HH:mm:ss:SSS' )
select from TestClass where IssueInstant = '2012-05-14 13:41:23:214'
Indeed, both queries below select the records I defined. It seems that datetime milliseconds are ignored!
select from TestClass where IssueInstant = date( '2012-05-14 13:41:23:000', 'yyyy-MM-dd HH:mm:ss:SSS' )
select from TestClass where IssueInstant = '2012-05-14 13:41:23:000'
Affected versions:
1.0rc9 and the latest
1.0-SNAPSHOT (downloaded from
https://oss.sonatype.org/content/groups/public/com/orientechnologies/orientdb/1.0-SNAPSHOT/orientdb-1.0-20120505.121554-24-distribution.zip).
The results are the same even if the SQL INSERT statements are run through the Java APIs.
Any idea?
TIA,
Salvatore