Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-5183

Bad support of batch, server and db with different timezones

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1
    • Component/s: Database
    • Labels:
      None

      Description

      In most cases timezone is not persisted in db columns with type TIMESTAMP. It can lead to side-effects on some environments, for example :

      • locale of server and db is GMT
      • locale of batch is GMT-5. When it is executed at 08.00.00-0500, timezone of ISSUES.CREATED_AT is lost -> value is 08.00.00+0000

      This behavior was verified on MSSQL 2008 and MySQL 5.6. Other databases were not tested.

      It leads to unexpected behaviors, for example SONAR-5049 or comparison of dates in the issues search form.

      The solution is to store only UTC timestamps in database. A simple workaround for MySQL is to complelete JDBC URL with

      useLegacyDatetimeCode=false

      . MSSQL requires to programmatically convert timestamps to UTC.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bteryk OLD - Teryk Bellahsene
              Reporter:
              simon.brandhof Simon Brandhof (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: