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

bind vars generation failed when use both WHERE + IN and HAVING. #65

Closed
sio4 opened this issue Apr 17, 2018 · 3 comments
Closed

bind vars generation failed when use both WHERE + IN and HAVING. #65

sio4 opened this issue Apr 17, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@sio4
Copy link
Member

sio4 commented Apr 17, 2018

If I use something like WHERE id in (?) and HAVING count(id) = ? at the same time, it does not compiled expectedly.

The line below is called if there is in (?) on SQL which is built by buildSelectSQL(), but there is another ? for HAVING and sqlx.In() returns error "number of bindVars exceeds arguments". (I cannot sure since I just checked it on pop code and did not get into sqlx code anyway.)

s, _, err := sqlx.In(sq.sql, sq.Args())

IMHO, we can move this lines into buildWhereClauses(). Can I open a PR for this?

@markbates
Copy link
Member

There's a PR already for this issue, #67, should be merged today or tomorrow.

@stanislas-m stanislas-m added the bug Something isn't working label Apr 19, 2018
@stanislas-m
Copy link
Member

Fixed with #67.

@sio4
Copy link
Member Author

sio4 commented Apr 19, 2018

Nice, it works well!

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

3 participants