Skip to content

IsIn condition with empty list is not rendered, and selects the entire table #562

Closed
@franck102

Description

@franck102

I have found this issue that discusses the problem:
[https://github.com//issues/228]

... however I don't understand if or how the issue was resolved. The documentation mentions a NonRenderingWhereClauseException that should be thrown with the default configuration, however this is not the behavior I am seeing with org.mybatis.dynamic-sql:mybatis-dynamic-sql:1.4.1: the condition is simply dropped and the entire table is returned.
Looking through the source code of the IsIn class I don't see that exception being used anywhere... am I missing something? I tried explicitly setting nonRenderingWhereClauseAllowed to true in a global config file and that didn't make any difference.

Above all, why can't IsIn() simply be rendered as "WHERE FALSE"??? This seems like the natural, safe, easy thing to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions