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

Count(&count) retrives right result but raises an error #9

Closed
regorov opened this issue Nov 10, 2013 · 1 comment
Closed

Count(&count) retrives right result but raises an error #9

regorov opened this issue Nov 10, 2013 · 1 comment

Comments

@regorov
Copy link

regorov commented Nov 10, 2013

Hi !

var
    count int64
    err := db.Model(User{}).Where("mobile = ?", mobile).Count(&count).Error
       fmt.Printf("Error: %v\n", err)

prints:

SQL is not valid, count(*)

and count has right value. I passed go test and results are the same. PostgreSQL 8.4.2, compiled by Visual C++ build 1400, 32-bit

@jinzhu
Copy link
Member

jinzhu commented Nov 10, 2013

Thank you for your report, this has been fixed.

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

No branches or pull requests

2 participants