Skip to content

Add failing test case for findAndCountAll with a include and where#4016

Merged
janmeier merged 1 commit intosequelize:masterfrom
d0b1010r:findAndCountAll-include-where
Jun 28, 2015
Merged

Add failing test case for findAndCountAll with a include and where#4016
janmeier merged 1 commit intosequelize:masterfrom
d0b1010r:findAndCountAll-include-where

Conversation

@d0b1010r
Copy link
Copy Markdown
Contributor

This is a test case for findAndCountAll returning an incorrect value for result.count, as the where statement in the include makes the count() sql function counts all rows instead (3 in this case) of only matching Foos (2 in this case).

See issue #4015

@janmeier janmeier merged commit af6723b into sequelize:master Jun 28, 2015
janmeier added a commit that referenced this pull request Jun 28, 2015
Add failing test case for findAndCountAll with a include and where
@janmeier
Copy link
Copy Markdown
Member

Fixed by adding a distinct to the count part when there are any include on the count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants