[jOOQ/jOOQ#12425] Fixed Derby regression in GREATEST, LEAST emulation

This commit is contained in:
Lukas Eder 2021-09-30 16:45:37 +02:00
parent fc1aa76d5b
commit 706241241a
2 changed files with 2 additions and 4 deletions

View File

@ -90,8 +90,7 @@ final class Greatest<T> extends AbstractField<T> implements MGreatest<T> {
Field<T> other = (Field<T>) args.get(1);
if (args.size() > 2) {
Field<?>[] remaining = new Field[args.size() - 2];
System.arraycopy(args, 2, remaining, 0, remaining.length);
Field<?>[] remaining = args.subList(2, args.size()).toArray(Tools.EMPTY_FIELD);
ctx.visit(DSL
.when(first.gt(other), DSL.greatest(first, remaining))

View File

@ -89,8 +89,7 @@ final class Least<T> extends AbstractField<T> implements MLeast<T> {
Field<T> other = (Field<T>) args.get(1);
if (args.size() > 2) {
Field<?>[] remaining = new Field<?>[args.size() - 2];
System.arraycopy(args, 2, remaining, 0, remaining.length);
Field<?>[] remaining = args.subList(2, args.size()).toArray(Tools.EMPTY_FIELD);
ctx.visit(DSL
.when(first.lt(other), DSL.least(first, remaining))