[patch] MySQL backend does not handle zero dates
|Reported by:||jbowtie@…||Owned by:||adrian|
|Component:||Database layer (models, ORM)||Version:|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The MySQL backend installs custom conversions for DateFields and DateTimeFields. These conversion functions fail when parsing zero dates with "ValueError: year is out of range".
Solution one is to allow default MySQL parsing, which transparently treats zero dates as NULL and converts valid dates to datetime objects.
Solution two is to modify the conversion functions to return None when encountering a zero date.
Change History (5)
comment:4 Changed 9 years ago by wam-djangobug@…
- Summary changed from MySQL backend does not handle zero dates to [patch] MySQL backend does not handle zero dates