WIP: Make ->count call ->count_rs->first unless software_limit=1 wip/count-no-soft-limit
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Fri, 26 Feb 2016 11:00:39 +0000 (11:00 +0000)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Fri, 26 Feb 2016 11:01:50 +0000 (11:01 +0000)
commit47bc746e9372902edd584d30b27289a46735dc9f
treef5eef1ac58ece1e32a7bbed059c36e9e43b469d8
parent7db287353abcf82c4fe856d4636384084ed5c13f
WIP: Make ->count call ->count_rs->first unless software_limit=1

This removes the (at least sometimes) bogus "optimisation" of not
passing the rows/offset to the DB when counting, unless explicitly asked
for.  It may have to be reinstated on a per-DB (or per limit dialect)
basis.

Also removes bogus ->count test in fetch_first, since
a) software_limit completely removes the paging logic from ->count.
b) SQLite doesn't support FETCH FIRST x ROWS ONLY

TODO: Figure out if ->count can be further simplified.
lib/DBIx/Class/ResultSet.pm
t/count/count_rs.t
t/sqlmaker/limit_dialects/fetch_first.t