Defect in RC - Loading all entities mess up internal data structures...

3 views
Skip to first unread message

T T

unread,
Dec 21, 2009, 10:12:49 AM12/21/09
to Outlet ORM
I believe (hopefully I am wrong and missing something) I found a
defect. This is what I do:

//--just using $allEntities for outputting some stuff to the browser.
1) $allEntities = $orm->select('Entity');

//--now load any entity with any valid id
2 $id = 18;
3) $entity = $orm->load('Entity', $id);

//--change any property
3) $entity->property = 'some new value';

//--suppose to save entity but this is not the case
4) $orm->save($entity);

I am getting the following error:
Syntax error or access violation: 1064 You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'WHERE id = '18''

I checked the real SQL UPDATE statement and it is:

UPDATE entities SET WHERE id = '18'

Note how there are no field=value list after the SET keyword.

Once I remove the line #1 (loading all entities), the code works
perfectly well. Looks like loading all entitiess mess up internal data
structures, etc. Please note that even if you replace lines #2, #3
with foreach iteration (the right way to access loaded entities) the
same thing happens. So, this is a major thing I beleive because it
stops developers from using a very good use case: loading entities,
iterating over them, doing some changes, and saving some entities
back.

Hope you or someone else can fix that shortly - completely flat out
these days, won't be able to contribute, sorry.


Fabio R.

unread,
Dec 21, 2009, 6:58:07 PM12/21/09
to outle...@googlegroups.com
Hi T T,

Thanks for reporting the bug.

We've fixed the code and it is on trunk:
svn://knowledgehead.com/outlet/outlet-orm/trunk

Would you be able to test it and see if things are running fine? Would be nice to have a feedback before releasing 1.0rc2.


Cheers,
--
Fábio Rehm






--

You received this message because you are subscribed to the Google Groups "Outlet ORM" group.
To post to this group, send email to outle...@googlegroups.com.
To unsubscribe from this group, send email to outlet-orm+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/outlet-orm?hl=en.



T T

unread,
Dec 21, 2009, 9:30:51 PM12/21/09
to Outlet ORM
You guys rock!

I ran the test again and it works like a charm. Thanks a lot for your
fantastic effort!

Cheers!


On Dec 22, 10:58 am, "Fabio R." <fgr...@gmail.com> wrote:
> Hi T T,
>
> Thanks for reporting the bug.
>
> We've fixed the code and it is on trunk:
> svn://knowledgehead.com/outlet/outlet-orm/trunk
>
> Would you be able to test it and see if things are running fine? Would be
> nice to have a feedback before releasing 1.0rc2.
>
> Cheers,
> --
> Fábio Rehm
>

> > outlet-orm+...@googlegroups.com<outlet-orm%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages