User tests: Successful: Unsuccessful:
Related to #5010
PostgreSQL allows to have an OFFSET without a LIMIT in the database query. In MySQL the OFFSET has to follow a LIMIT.
Thus our JDatabaseQueryPostgresql
class thus allows to clear the limit independant from the offset, while our other database classes clear both limit and offset together with one call to $query->clear('limit')
.
So far so good.
If you now use $query->clear( 'offset')
it works as expected in PostgreSQL. But if you do the same in any other databases it will actually clear the full query since this case isn't defined and thus it uses the default case.
This PR adds the case offset
to the JDatabaseQuery
class so all databases will support that case and allow to clear the offset.
This PR also adds a ->clear('offset')
to the JModelLegacy->_getListCount()
method. For MySQL and other databases this will not change anything as the offset is already cleared with ->clear('limit')
anyway. But it will fix the query for PostgreSQL and properly clear the offset there as well
Create a list/blog where you get pagination and make sure the total and pagination works as expected.
With MySql you should see no difference at all. With PostgreSQL it should work with the patch.
Labels |
Added:
?
|
Merged, thanks for testing!
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-11-08 12:35:14 |
Yes it works with PostgreSQL. Thank you.