Disabling paging by passing an options array with paging => false produces a LIMIT -1 query, when I initiate a column ordering by clicking on a column header. At least MySQL, MariaDB and apparently PostgreSQL don't allow negative LIMIT values.
In this PR https://github.com/omines/datatables-bundle/pull/257 the behaviour to build the query limit was changed. The adapters now expect NULL to set no limit or they'll pass any value to the setMaxResults method. Previously, only positive integers were passed.
Disabling paging by passing an options array with paging => false produces a LIMIT -1 query, when I initiate a column ordering by clicking on a column header. At least MySQL, MariaDB and apparently PostgreSQL don't allow negative LIMIT values.
The cause is two-folded:
The DataTables JS framework sets the displayLength parameter on ajax calls to -1 if paging is disabled: https://github.com/DataTables/DataTablesSrc/blob/235e96c5ebf8e1e84e63ad5645bfae0dde0f4e27/js/core/core.ajax.js#L188
In this PR https://github.com/omines/datatables-bundle/pull/257 the behaviour to build the query limit was changed. The adapters now expect NULL to set no limit or they'll pass any value to the setMaxResults method. Previously, only positive integers were passed.