Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21569

Inconsistent date column types on mysql for a wiki that's been upgraded from before ~12.10.x

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 13.10.10, 14.10.18
    • Old Core
    • Unknown

    Description

      This issue impacts XWiki installed with Mysql servers (probably MariaDB as well, but it could not be 100% confirmed).

      Setup of the xwiki instance when the issue will reproduce:

      • mysql 8+ or equivalent mariadb version
      • XWiki version 11.10+
      • the instance's main wiki or some other subwiki needs to exist for a long time and to have been upgraded
        • ideally, they need to exist since before mysql 8+/mariadb was used (I think, but it's not 100% sure that this is the cause)
      • a new subwiki needs to be created after the move to mysql 8+/mariadb and upgrade of XWiki

      Expected result:
      The types and tables definitions are the same between the existing subwikis and newly created subwiki.

      Actual result:
      The date types of the datetime columns (the XWS_VALUE column of xwikidates, or XWD_DATE, XWD_CREATION_DATE and XWD_CONTENT_UPDATE_DATE of xwikidoc, etc) are different between the wikis, in terms of datatype:

      • for the tables of existing wikis the type is datetime
      • for the tables of the newly created wikis the type is datetime(6).

      This impacts the way the milliseconds are handled, the type 'datetime' does not store any milliseconds at all and rounds the value. The type datetime(6) stores the milliseconds with precision of 6 (up to microseconds).

      Otherwise put, the issue here is that the datetime type used by hibernate for mysql / mariadb for the "timestamp" hibernate mapping is not migrated automatically to datetime(6) upon upgrade of XWiki.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: