[Dbix-class] Re: RFC: Patch for InflateColumn::Datetime to handle invalid date values

A. Pagaltzis pagaltzis at gmx.de
Fri Jun 15 03:04:34 GMT 2007


* 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:

    mysql> create temporary table foo ( bar date not null );
    Query OK, 0 rows affected (0.03 sec)

    mysql> insert into foo values ('0000-00-00');
    Query OK, 1 row affected (0.00 sec)

    mysql> select count(*) from foo where bar is not null;
    +----------+
    | count(*) |
    +----------+
    |        1 | 
    +----------+
    1 row in set (0.03 sec)

    mysql> select count(*) from foo where bar is null;
    +----------+
    | count(*) |
    +----------+
    |        1 | 
    +----------+
    1 row in set (0.00 sec)

Isn’t that bloody excellent?

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Dbix-class mailing list