Skip to content

Commit

Permalink
fix: fold empty within condition to false/true
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed Oct 11, 2024
1 parent 56c2d47 commit a98705d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ abstract class GenericQueryGenerator : SqlQueryGenerator {
}
is WithinCondition<*, *> -> {
when {
expression.values.isEmpty() -> GeneratorResult(query = "TRUE")
expression.values.isEmpty() ->
when (expression.type) {
WithinType.IN -> GeneratorResult(query = "FALSE")
WithinType.NOT_IN -> GeneratorResult(query = "TRUE")
}
expression.values.size == 1 ->
createExpression(
allocator,
Expand Down

0 comments on commit a98705d

Please sign in to comment.