Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-8970

SQLDataSets filtering by date params calculates a wrong Timestamp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 7.31.0.Final
    • Dashboard Builder
    • None
    • NEW
    • NEW
    • Hide

      1) let's have an SQLDataSet that is defined with a query against the product table audittaskimpl.

      e.g. "select taskid, lastmodificationdate from audittaskimpl"

      2) let's filter the DataSet by the lastmodificationdate column and using the following java.util.Date instance -> "2020-01-06T11:20:43.042+0100" (note that for the report the toString() value is shown, but the java.util.Date instance was used.)

      3) this is the native query generated by the DataSet.

      SELECT taskid, lastmodificationdate from audittaskimpl
      WHERE lastmodificationdate >= TIMESTAMP '2020-01-06 11:20:43.42'

      4) the milliseconds for the generated TIMESTAMP for the query are wrong,
      see that the java.sql.Date parameter has "042" milliseconds but the generated timestamp has "42" = "420" milliseconds.

      the correct timestamp should be like this -> TIMESTAMP '2020-01-06 11:20:43.042'

      note: the issue was find with a postgresql database

      Show
      1) let's have an SQLDataSet that is defined with a query against the product table audittaskimpl. e.g. "select taskid, lastmodificationdate from audittaskimpl" 2) let's filter the DataSet by the lastmodificationdate column and using the following java.util.Date instance -> "2020-01-06T11:20:43.042+0100" (note that for the report the toString() value is shown, but the java.util.Date instance was used.) 3) this is the native query generated by the DataSet. SELECT taskid, lastmodificationdate from audittaskimpl WHERE lastmodificationdate >= TIMESTAMP '2020-01-06 11:20:43.42' 4) the milliseconds for the generated TIMESTAMP for the query are wrong, see that the java.sql.Date parameter has "042" milliseconds but the generated timestamp has "42" = "420" milliseconds. the correct timestamp should be like this -> TIMESTAMP '2020-01-06 11:20:43.042' note: the issue was find with a postgresql database

      When we have an SQLDataSet that has a date/timestamp field "XXX" and the query is filtered by "XXX" a wrong timestamp is calculated in the generated query.

              david.magallanes David Gutierrez
              wmedvede@redhat.com Walter Medvedeo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: