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

Incorrect conversion of time/datetime values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.54
    • Fix Version/s: 0.9.55
    • Component/s: DBAPI 2.0
    • Labels:
      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

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

              Dates

              Created:
              Updated:
              Resolved: