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

Change "in" Condition Rendering - Render With Empty Lists #794

Merged
merged 11 commits into from
May 19, 2024

Conversation

jeffgbutler
Copy link
Member

This is a potentially breaking change. The "in" conditions will now render even if the list of input values is empty. This will cause a runtime exception for invalid SQL. This change is made out of an abundance of caution after many issues have been raised about it.

For example see #228, #509, #752, #788

Resolves #788

This will force an empty list condition to render by default - which will cause an SQLException. After much discussion and many issues, we decided this was the safest approach.
These conditions will not render if empty regardless of configuration settings. This is consistent with the other "when present" conditions.
With this change, the "in" conditions will always render. The "in when present" conditions will only render if the input collection is non-null and contains at least one non-null value.
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling f5a5318 on jeffgbutler:new-in-rendering
into dc169f2 on mybatis:master.

@jeffgbutler jeffgbutler added this to the 1.5.2 milestone May 19, 2024
@jeffgbutler jeffgbutler merged commit 28ba6f3 into mybatis:master May 19, 2024
6 checks passed
@jeffgbutler jeffgbutler deleted the new-in-rendering branch May 19, 2024 18:08
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

Successfully merging this pull request may close these issues.

Rendering empty list by default
2 participants