#1831 - Update query with maxRows does not include the limit in the generated SQL

This commit is contained in:
rob bygrave
2019-10-11 17:01:30 +13:00
parent 4e74c68603
commit b665d8375c
10 changed files with 280 additions and 191 deletions
@@ -692,13 +692,15 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
}
/**
* Setup to be a delete query.
* Setup to be a delete or update query.
*/
@Override
public void setDelete() {
public void setupForDeleteOrUpdate(boolean deleteRequest) {
// unset any paging and select on the id in the case where the query
// includes joins and we use - delete ... where id in (...)
maxRows = 0;
if (deleteRequest) {
maxRows = 0;
}
firstRow = 0;
forUpdate = null;
rootTableAlias = "${RTA}"; // alias we remove later