Reading date '0000-00-00' from db results in conversion exception
Bug #438857 reported by
analogue
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Connector/Python |
Fix Released
|
Medium
|
Geert JM Vanderkelen |
Bug Description
A date value of 0000-00-00 is apparently valid in mysql. When attempting to read this value from the db, a conversion exception is thrown.
'Could not convert '0000-00-00' to python datetime.date'
From a compatibility perspective, the MySQLdb python bindings which uses the native _mysql.so handles this fine and returns the earliest date possible. Something like '1970-01-01' I think.
I would be nice when dropping in the pure python implementation, that it would behave the same as the native version of the python bindings.
Changed in myconnpy: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
Yes, but return 1970-01-01 is also wrong. That's incorrect data.
I'll check this further out. We have to return something, but the year 0000 is not 1970 :)
Thanks for the report!