Skip to content

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

@sio4

Description

@sio4

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions