[jOOQ/jOOQ#9998] DSL.and(noCondition()) and DSL.or(noCondition()) generates a "1 = 1" or "1 = 0" predicate
This commit is contained in:
parent
6bfef10081
commit
cbd3239233
@ -43,6 +43,7 @@ import static org.jooq.Clause.CONDITION_AND;
|
||||
import static org.jooq.Clause.CONDITION_OR;
|
||||
import static org.jooq.Operator.AND;
|
||||
import static org.jooq.impl.DSL.falseCondition;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.trueCondition;
|
||||
import static org.jooq.impl.Keywords.K_AND;
|
||||
import static org.jooq.impl.Keywords.K_OR;
|
||||
@ -97,6 +98,12 @@ final class CombinedCondition extends AbstractCondition {
|
||||
return result;
|
||||
else if (first != null)
|
||||
return first;
|
||||
|
||||
// [#9998] All conditions were NoCondition
|
||||
else if (!conditions.isEmpty())
|
||||
return noCondition();
|
||||
|
||||
// [#9998] Otherwise, return the identity for the operator
|
||||
else if (operator == AND)
|
||||
return trueCondition();
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user