[jOOQ/jOOQ#9930] Fixed ListAgg for SQL Server

This commit is contained in:
Lukas Eder 2020-03-31 15:39:46 +02:00
parent aa20f07f4e
commit c790c84d99
2 changed files with 9 additions and 1 deletions

View File

@ -125,7 +125,7 @@ class DefaultAggregateFunction<T> extends AbstractAggregateFunction<T> {
/**
* Render <code>WITHIN GROUP (ORDER BY ..)</code> clause
*/
private final void acceptWithinGroupClause(Context<?> ctx) {
final void acceptWithinGroupClause(Context<?> ctx) {
if (withinGroupOrderBy != null) {
ctx.sql(' ').visit(K_WITHIN_GROUP)
.sql(" (").visit(K_ORDER_BY).sql(' ');

View File

@ -51,6 +51,7 @@ import static org.jooq.SQLDialect.POSTGRES;
import static org.jooq.SQLDialect.SQLITE;
// ...
// ...
// ...
import static org.jooq.impl.Keywords.F_CONCAT;
import static org.jooq.impl.Keywords.F_SUBSTR;
import static org.jooq.impl.Keywords.F_XMLAGG;
@ -110,6 +111,10 @@ final class ListAgg extends DefaultAggregateFunction<String> {
else if (SUPPORT_STRING_AGG.contains(ctx.dialect())) {
acceptStringAgg(ctx);
acceptFilterClause(ctx);
acceptOverClause(ctx);
}
@ -169,6 +174,9 @@ final class ListAgg extends DefaultAggregateFunction<String> {
else
ctx.sql(", ''");
acceptOrderBy(ctx);
ctx.sql(')');
}