Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.0.0
Description
While MariaDB allows negative time values, they can't be stored in Python's datetime.time object and will be returned as a positive time value.
>>> import mariadb
|
>>> conn=mariadb.connect(db="testp")
|
>>> cur=conn.cursor()
|
>>> cur.execute("create temporary table t1 (a time)")
|
>>> cur.execute("insert into t1 values ('-23:00')")
|
>>> cur.execute("select a from t1")
|
>>> cur.fetchone()
|
(datetime.time(23, 0),)
|
>>> cur.execute("select cast(a as char) from t1")
|
>>> cur.fetchone()
|
('-23:00:00',)
|
Instead of storing time values in datetime.time, they should be stored in datetime.timedelta.
Attachments
Issue Links
- blocks
-
CONPY-77 Add mariadb dialect to sqlalchemy
- Closed