Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-45

Incorrect conversion of time/datetime values

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 0.9.54
    • 0.9.55
    • DBAPI 2.0
    • None

    Description

      When converting time types with microseconds, the number of microseconds is incorrect.

      Example:

          def test_time(self):
              con= create_connection()
              cursor = con.cursor()
              cursor.execute("CREATE TEMPORARY table t1 (a time(3))")
              cursor.execute("INSERT INTO t1 VALUES ('13:12:24.05111')")
              cursor.execute("SELECT a FROM t1");
              row= cursor.fetchone()
              self.assertEqual(row[0], datetime.time(13, 12, 24, 51000)) 
              del cursor
              del con
      

      Output:

      AssertionError: datetime.time(13, 12, 24, 51) != datetime.time(13, 12, 24, 51000)
      

      Attachments

        Activity

          People

            georg Georg Richter
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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