Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

incorrect sql for limit + count (DM 1.0) #8

Open
solnic opened this issue May 17, 2011 · 3 comments
Open

incorrect sql for limit + count (DM 1.0) #8

solnic opened this issue May 17, 2011 · 3 comments

Comments

@solnic
Copy link
Contributor

solnic commented May 17, 2011

In DM 1.0, the expression Foo.all(:limit=>2).count
produces the query
SELECT COUNT(*) FROM foos LIMIT 2
which is incorrect, as the precedence of LIMIT applies to the one row
returned by count.
This is a big deal with many pagination plugins.


Created by Gary Yngve - 2010-06-23 04:55:07 UTC

Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1334

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

(from [1f9b8bf]) Add failing spec for #count called on a limited collection

[#1334 state:confirmed]
[#1203 state:confirmed]
[#1416 state:confirmed]
http://github.com/datamapper/dm-aggregates/commit/1f9b8bf0d97a2458b9721e5fa02a7f1f69fdcdf3

by Dan Kubb (dkubb)

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

(from [0b2afc9]) Mark #count on a limited collection spec as pending

[#1334 state:confirmed]
[#1203 state:confirmed]
[#1416 state:confirmed]
http://github.com/datamapper/dm-aggregates/commit/0b2afc96e4917e868853f3c9ddcc5c8f31ba58e5

by Dan Kubb (dkubb)

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

[bulk edit]

by Dan Kubb (dkubb)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant