update() with limit() #743

Open
ciromattia opened this Issue Aug 20, 2013 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

ciromattia commented Aug 20, 2013

I got an unexpected behavior with update() combined with limit().
The following code:

ItemQuery::create()
->filterByStatus('A')
->filterByHome(2)
->orderByArrivalDate(Criteria::DESC)
->limit(1)
->update(array('Status' => 'B');

is expected to give the query

UPDATE `item` SET status = 'B'
WHERE item.status='A' AND item.home='2'
ORDER BY item.arrival_date DESC
LIMIT 1

which updates a SINGLE row (the last arrived).
I got instead an update on ALL items filtered by the query, like the limit(1) was ignored by update().
Is it a known Propel behavior?

Yes, this is a known issue. It was in the old Trac system: http://trac.propelorm.org/127.0.0.1_8882/ticket/987.html

Contributor

stevleibelt commented Jun 9, 2016

@jwong-dayspring

Your link is not working anymore.
Is there a status if this gets fixed or a general way to work around?
This is our workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment