Skip to content

docs: setFirstResult()/setMaxResults() only apply to SELECT queries - #7506

Open
Amoifr wants to merge 1 commit into
doctrine:4.4.xfrom
Amoifr:docs-7119-limit-select-only
Open

docs: setFirstResult()/setMaxResults() only apply to SELECT queries#7506
Amoifr wants to merge 1 commit into
doctrine:4.4.xfrom
Amoifr:docs-7119-limit-select-only

Conversation

@Amoifr

@Amoifr Amoifr commented Aug 25, 2026

Copy link
Copy Markdown
Q A
Type improvement
Fixed issues #7119

Summary

Documents in the Limit Clause section of the query builder reference that setFirstResult()/setMaxResults() only apply to SELECT queries and are ignored on UPDATE/DELETE, as requested in #7119: vendor-specific syntax such as MySQL's DELETE ... LIMIT has no portable equivalent, so the query builder does not emulate the clause there. Also points to the WHERE-clause alternative (restricting to a set of primary keys selected beforehand).

The limit emulation only exists for SELECT: on UPDATE and DELETE the
methods are silently ignored, since vendor-specific syntax such as
MySQL's DELETE ... LIMIT has no portable equivalent.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant