Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1196

java.util.Date regression

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.0.11
    • None
    • datetime
    • JVM via Clojure

    Description

      While updating a legacy system from 2.x into 3.x we noticed a regression in how java.util.Date objects get saved to our mariadb database.

      The appears to have been introduced in the transition from 2.7 to 3.x

      The issue is that the connector strips the timestamp from the object before saving to the database meaning:
      2024-08-14T08:30:41.842-00:00
      is saved as:
      2024-08-14T00:00:00.000Z

      This is not the case for equivalent org.joda.time.DateTime objects

      It would appear that the implementation created in 3.0.5 assumes that java.util.Date objects just represent Dates. Whereas the documentation describes them as instants in time to millisecond precision.
      https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Date.html

      Any help diagnosing and understanding this issue would be greatly appreciated.
      See attached files for relevant code examples in clojure.

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              Rob Wood Robert
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.