Problem appears to be this line in cake/libs/model/datasource/
dbo_source.php

                $null = ($value === null || (is_array($value) && 
empty($value)));


Should be:

                $null = ($value == null || (is_array($value) && empty($value)));

I'm the value is being cast from a null to a string somewhere before
this code is being executed and the absolutely equal (===) is failing
because the datatype of a null string is different to the null its
being compared to.

Should I ticket this?


On May 28, 3:22 pm, "rich...@home" <richardath...@gmail.com> wrote:
> In the model:
>
> $this->find("first", array(
>         "conditions"=>array(
>                 "OrderDetail.id"=>""
>         )
> ))));
>
> Produces the following SQL where clause:
>
> WHERE `OrderDetail`.`id` = NULL
>
> That will never match any records (comparing anything directly with
> NULL always results in NULL, ie. comparing anything with an unknown
> will always produce an unknown answer)
>
> The correct syntax should be:
>
> WHERE `OrderDetail`.`id` IS NULL
>
> Shouldn't CakePHP use IS NULL when building the where clause for NULL
> values in comparisons?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to