[Dbix-class] Re: RFC: Patch for InflateColumn::Datetime to handle
invalid date values
Richard Jolly
richardjolly at mac.com
Thu Jun 21 08:33:09 GMT 2007
On 15 Jun 2007, at 13:56, Jason Kohles wrote:
> On Jun 15, 2007, at 7:31 AM, Matt S Trout wrote:
>
>> On Thu, Jun 14, 2007 at 09:14:48PM -0500, Brandon Black wrote:
>>> On 6/14/07, A. Pagaltzis <pagaltzis at gmx.de> wrote:
>>>> * Matt S Trout <dbix-class at trout.me.uk> [2007-06-14 19:50]:
>>>>> if mysql considers that equivalent to null
>>>>
>>>> It does *and* does not:
>>>
>>> That doesn't surprise me at all. It's not like you're using an
>>> actual
>>> relational database :p
>>>
>>> Maybe this will finally drive it home for everyone: MySQL is to
>>> database server software what PHP is to programming languages.
We've just been bitten by this kind of issue. In our case it's an empty
string silently converted to 0 in an integer column. Which reminded me
of perl :).
You can use strict mode in mysql, which hopefully clears most of this
up. We'll be trying soon. From the docs:
"Make MySQL behave like a“traditional" SQL database system. A simple
description of this mode is “give an error instead of a warning” when
inserting an incorrect value into a column"
http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
Richard
More information about the Dbix-class
mailing list