Skip to content

Optionally Allow Empty List Conditions to Render #764

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

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

jeffgbutler
Copy link
Member

Add a configuration setting to allow empty list conditions to render. By default, empty list conditions will be dropped from a where clause - which could generate a statement that affects more rows then expected. This change adds a configuration setting that will allow empty list conditions to render. An example of a rendered empty list condition would be in () or not in (). This is invalid SQL and it could cause an SQLException at runtime, but it might be useful as a safety measure for unvalidated input.

Preceded by refactoring slices #754 and #763

Resolves #752

Also related to #228, #509, and #562

Added a configuration setting to allow empty list conditions to render. This could cause an SQLException at runtime, but might be useful as a safety measure for unvalidated input.
@jeffgbutler jeffgbutler added this to the 1.5.1 milestone Mar 26, 2024
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 45da95e on jeffgbutler:render-empty-lists
into 60cb080 on mybatis:master.

@jeffgbutler jeffgbutler merged commit 0e91dad into mybatis:master Mar 26, 2024
5 of 6 checks passed
@jeffgbutler jeffgbutler deleted the render-empty-lists branch March 26, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render in(emptyList) and notIn(emptyList) more reasonably
2 participants