You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "Jakub Neubauer (JIRA)" <ji...@apache.org> on 2017/11/10 10:04:00 UTC
[jira] [Created] (METAMODEL-1169) MS Sql and queries with WHERE
part on datetime or timestamp columns lost milliseconds precision
Jakub Neubauer created METAMODEL-1169:
-----------------------------------------
Summary: MS Sql and queries with WHERE part on datetime or timestamp columns lost milliseconds precision
Key: METAMODEL-1169
URL: https://issues.apache.org/jira/browse/METAMODEL-1169
Project: Apache MetaModel
Issue Type: Bug
Affects Versions: 4.5.6
Reporter: Jakub Neubauer
An example, where a query is constructed that compares some `datetime` column with a value.
{code:java}
Query q = ...
java.util.Date datetimeValue = createDatetime('2017-01-01 12:00:00.500');
q.where(column, OperatorType.GREATER_THAN, datetimeValue);
{code}
If there is a row with the appropriate column value for example `2017-01-01 12:00:00.157`, this row should NOT be selected, but currently it IS, since the milliseconds are trimmed to 0 in the query operand.
Only on MS SQL database. The problem is probably in `SQLServerQueryRewriter.rewriteFilterItem` class & method.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)