[Dbix-class] RFC: Patch for InflateColumn::Datetime to handle
invalid date values
Matt S Trout
dbix-class at trout.me.uk
Thu Jun 14 18:43:54 GMT 2007
On Wed, Jun 13, 2007 at 11:49:28AM -0700, John Napiorkowski wrote:
> Hi,
>
> I'm running into a problem with
> DBIC::InflateColumn::Datetime on MySql 5 when the
> datetime column has an invalid value. Seems like
> Mysql5 likes to set timestamp columns to 00-00-00
> 00:00:00 if there is a null value. Anyway, this
> database I'm inheriting is littered with rows like
> that and I have no access to the fix the systems
> causing that data.
>
> The problem is that when the mentioned module tries to
> inflate those values DateTime throws an exception,
> rightfully so, since that value isn't a valid date or
> time value.
Hmm, if mysql considers that equivalent to null then having the
datetime_parser object returned by storage return undef seems pretty
reasonable to me.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
More information about the Dbix-class
mailing list