Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findAndCount returning NaN for count #858

Closed
followben opened this issue Sep 22, 2020 · 6 comments
Closed

findAndCount returning NaN for count #858

followben opened this issue Sep 22, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@followben
Copy link
Contributor

followben commented Sep 22, 2020

Describe the bug
When using findAndCount on Postgres with a filterQuery that includes inverse relations, count can incorrectly return NaN

To Reproduce
Steps to reproduce the behavior:

  1. check out https://github.com/followben/mikro-orm/tree/gh858
  2. run yarn test GH858

Expected behavior
Count returns a number greater than or equal to zero (or findAndCount() throws an error).

Versions

Dependency Version
node 12.x
typescript 3.9.7
mikro-orm 4.0.5
pg 8.3.0
@followben followben added the bug Something isn't working label Sep 22, 2020
@B4nan
Copy link
Member

B4nan commented Sep 22, 2020

Add a reproduction

@followben
Copy link
Contributor Author

Hah, you're too quick... I was upping one with the GH issue number attached.

@B4nan
Copy link
Member

B4nan commented Sep 22, 2020

Good, ty :]

Anyway, I never merge those "repro PRs", the idea was that this "single file repro" should be part of the issue - I will be the one adding it to the codebase together with a fix.

@followben
Copy link
Contributor Author

Why is that @B4nan? I mean, why aren't test cases worthy of merging?

@B4nan
Copy link
Member

B4nan commented Sep 22, 2020

Why would I merge something that will cause build failures?

@followben
Copy link
Contributor Author

Because someone went to the trouble of creating it as per the contribution guidelines. You can push to the PR to fix, correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants