Ticket #1601 (closed defect: fixed)
[PATCH] Workaround in paginate for databases without offset
|Reported by:||joelpearson||Owned by:||anonymous|
Using the paginate decorator in 1.0.4b2 with certain databases in SQLAlchemy produces the following exception:
InvalidRequestError: [database name] does not support LIMIT with an offset
I've attached a patch that works around this problem. This workaround is off by default, and must be enabled by adding a new variable to the [global] section of the dev.cfg and/or prod.cfg file:
If this variable exists in the config file and evaluates to True, then paginate uses "limit" in the database, but simulates "offset" by skipping over the results until it reaches the requested records. This is not particularly efficient, but in most cases it's more useful than the traceback screen that would otherwise result.