[jOOQ/jOOQ#9110] Fix rendering for countDistinct()

When calling `DSL#countDistinct(Field...)` with an empty array (as in
`countDistinct()`) the rendering is the same as for
`countDistinct(asterisk())`: `COUNT(DISTINCT *)`.
This commit is contained in:
Knut Wannheden 2019-09-03 09:08:08 +02:00
parent a3f25af543
commit e046ece89c

View File

@ -17865,7 +17865,8 @@ public class DSL {
*/
@Support({ H2, HSQLDB, MYSQL, POSTGRES })
public static AggregateFunction<Integer> countDistinct(Field<?>... fields) {
return new org.jooq.impl.Function<>("count", true, SQLDataType.INTEGER, nullSafe(fields));
fields = nullSafe(fields);
return fields.length == 0 ? countDistinct(asterisk()) : new org.jooq.impl.Function<>("count", true, SQLDataType.INTEGER, fields);
}
/**