If the query returns the correct amount of rows but they do not show
up in the resulting array... then I am out of my comfort zone. I
haven't had 1.1 running for almost a year. :)
It is highly unlikely that the latest 1.1 would have a bug of this
kind. The only thing I can think of that sound at all possible is that
1.1.19 does not like your version of MySQL or your choice of dbo
driver.
As you have probably noticed, there are not many trac-tickets or
questions in the group about problems with hasMany. You have a very
rare problem.
Another real long-shot that just came to mind is is you have defined
$name in your models? The following is from an old 1.1 project. I
remember that sometimes things went crazy without the $name even in
setups where they should not have been necessary.
Also, looking at VERSION.txt I see that I never updated Cake further
than 1.1.17 for that project.
class Project extends AppModel
{
var $name = 'Project';
var $hasMany = array('File' => array(
'order' => EFS_SORT_FILES,
'dependent' => true)
);
...
class File extends AppModel
{
var $name = 'File';
var $belongsTo = 'Project';
...
That is probably all I can do. I hope you figure it out of that
someone else can come up with a better idea.
/Martin
On Jul 8, 11:32 am, stefano <[EMAIL PROTECTED]> wrote:
> Martin,
> thank you for your tips.
>
> Unfortunately upgrading to 1.2 is not an option now... I can't decide
> it myself...
> I already had done the check you suggest, now I re-done... but
> everythings looks right...
>
> > The IN part is probably not the problem. It looks ok and is basically
> > shorthand for WHERE Donetask.order_id = 00019281 OR Donetask.order_id
> > = 00019280...
>
> I agree, but... ;-) The IN() part is the only difference I can see
> between the old and the new version.
>
> I try to explain:
>
> Running the script with debug=2 I can see that the query I mentioned
> above returns 21 rows that is the same result I obtain if I run the
> SELECT statement manually from the command line. So the query in
> itself is ok.
>
> What i find after some investigation is that:
>
> On 1.1.15, Cake runs a select query on Donetask for every Order item
> then it merges the resulting rows in the resultset array
>
> On 1.1.19, Cake runs only one query on Donetask with that WHERE ..
> IN() syntax. As said with debug=2 I can see that the number of
> resulting rows is correct, but looks like that cake can't merge the
> hasMany results in the resultset array
>
> I run the old and the new version on the same machine, same mysql
> server, even same db.
>
> Any other hint?
>
> Stefano
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---