[#7660] EVERY() aggregate function emulation doesn't yield NULL when aggregating empty sets
This commit is contained in:
parent
af0d8e1750
commit
e203490c3b
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.zero;
|
||||
|
||||
@ -79,12 +78,12 @@ final class BoolAnd extends Function<Boolean> {
|
||||
final Field<Integer> max = DSL.field("{0}", Integer.class, new CustomQueryPart() {
|
||||
@Override
|
||||
public void accept(Context<?> c) {
|
||||
c.visit(DSL.max(DSL.when(condition, zero()).otherwise(one())));
|
||||
c.visit(DSL.min(DSL.when(condition, one()).otherwise(zero())));
|
||||
toSQLOverClause(c);
|
||||
}
|
||||
});
|
||||
|
||||
ctx.visit(DSL.when(max.eq(zero()), inline(true)).otherwise(inline(false)));
|
||||
ctx.visit(DSL.field(max.eq(one())));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.zero;
|
||||
|
||||
@ -84,7 +83,7 @@ final class BoolOr extends Function<Boolean> {
|
||||
}
|
||||
});
|
||||
|
||||
ctx.visit(DSL.when(max.eq(one()), inline(true)).otherwise(inline(false)));
|
||||
ctx.visit(DSL.field(max.eq(one())));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user