mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1564: MySQL Failure when using setFirstResult() and omitting setMaxResults() #1961
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Dec 25, 2011).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user felicitus:
When using setFirstResult() and omitting setMaxResults(), MySQL throws an error. This was very confusing for me until I dumped the SQL statements and found out the reason.
I know that MySQL doesn't directly support this, their manual says that you should set the second parameter to LIMIT to a very high number (18446744073709551615 in their example).
I'd recommend that either throwing an error in the specific platform driver or follow the MySQL example.
@doctrinebot commented on GitHub (Dec 28, 2011):
Comment created by @beberlei:
Changed into improvement, i am not sure how this relates to other databases.
You can just use this workaround yourself so long.
@malukenho commented on GitHub (Jan 5, 2017):
@Ocramius @lcobucci It's related to
DBAL.I guessing it's not a real problem.
@Ocramius commented on GitHub (Jan 5, 2017):
Probably good enough to use ``LIMIT ' . \PHP_INT_MAX`.
@malukenho can you please port the issue to DBAL, so we can close it here?
@Ocramius commented on GitHub (Jan 5, 2017):
NVM, it is indeed already fixed in DBAL:
8f0e497312/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php (L67)