The bug is under number #1565 as an "enhancement".

/data/cake/trunk/cake/1.x.x.x/cake/libs/model/dbo/dbo_mysql.php

When saving to a model that doesn't follow the cake convention and has
no auto_increment primary key, save makes a call to lastInsertID,
which in turn calls $data = $this->fetchAll('SELECT LAST_INSERT_ID()
as id From '.$source). The fetchAll returns all the records in a table
and for a large table this makes $this->save() unacceptably slow.

LAST_INSERT_ID is suppose to return the "LAST" inserted id and *not*
all of the insertsed IDs in a multi-insert operation. Within the
"function lastInsertId", the fetchAll should be changed to fetchArray
instead.

Gil Vidals

-- 
[EMAIL PROTECTED]
Position Research, Inc.
Search engine results by research
tel: (760) 480-8291 fax: (760) 480-8271
www.PositionResearch.com



On 12/7/06, Krang <[EMAIL PROTECTED]> wrote:
>
> Right now I have a model named 'User' with 6 hasOne associations, 9
> hasMany associations, and 3 HABTM associations. Most of these models
> have associations of their own. However, when I try to run my
> controller code, which is simply:
>
>  $output = $this->User->findById(16);
>  debug($output);
>
> I get a controller dump, which is apparently neverending.  When I
> remove a couple of associations, it seems to load fine. As far as I can
> tell, there doesn't seem to be any one specific association that causes
> the controller dump.
>
> Also, I've tried setting User->recursive to -1, I still get the
> controller dump with all the associations.
>
> Anyone know what's going on?
>
> Thanks in advance
>
>
> >
>


-- 
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to