Closed
Description
I have a table with a column of type date with entries like 2016-00-00
(only partially set, e.g. the year only). pymysql fails to return this.
import pymysql
conn = pymysql.connect(...)
cur = conn.cursor()
cur.execute("SELECT publish_date FROM pub")
for row in cur:
print(row)
Will print only (None,)
.
I also reported this for peewee although it looks like this is a bug on pymysql side but I'm not exactly sure.
A work around is to use
cur.execute("SELECT CAST(publish_date AS char) FROM pub")
which will return the date as a string (e.g. it prints ("2016-00-00",)
).
Metadata
Metadata
Assignees
Labels
No labels