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

Recent change to fix rand panic, broke count #4

Closed
antonio-alexander opened this issue May 19, 2021 · 1 comment
Closed

Recent change to fix rand panic, broke count #4

antonio-alexander opened this issue May 19, 2021 · 1 comment

Comments

@antonio-alexander
Copy link

The recent change to fix the rand panic created a new issue, the count is always 0 because the type the empty interface is casted to is wrong, see code snippet below:

        switch r := rows[0].(type) {
        case int64: //correct type case
            count = r
        case map[string]interface{}: //wrong type cast
            count = cconv.LongConverter.ToLong(r["count"])
        }

https://github.com/pip-services3-go/pip-services3-postgres-go/blob/main/persistence/PostgresPersistence.go#L795

The query is correct, fixing the cast will solve the problem, alternatively you could modify the query (I think) if you wanted to maintain the map[string]interface{}.

@levichevdmitry
Copy link
Contributor

Please, use new fixed version in release v1.2.7

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