From 9d9a2e2415d35b1122ae7ec4eca3867d2449c992 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Tue, 26 Mar 2024 13:15:59 +0100 Subject: [PATCH] [jOOQ/jOOQ#15732] COUNT(DISTINCT a, b) should be COUNT(DISTINCT (a, b)) --- .../main/java/org/jooq/impl/AbstractAggregateFunction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java b/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java index e9ed4de8a1..7fb7218287 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java @@ -114,7 +114,7 @@ implements static final Set NO_SUPPORT_FILTER = SQLDialect.supportedUntil(CUBRID, DERBY, IGNITE, MARIADB, MYSQL); static final Set NO_SUPPORT_WINDOW_FILTER = SQLDialect.supportedBy(TRINO); - static final Set SUPPORT_DISTINCT_RVE = SQLDialect.supportedBy(H2, POSTGRES); + static final Set REQUIRE_DISTINCT_RVE = SQLDialect.supportedBy(DUCKDB, H2, POSTGRES); static final Lazy> ASTERISK = Lazy.of(() -> DSL.field(DSL.raw("*"), Integer.class)); @@ -268,7 +268,7 @@ implements // [#2883][#9109] PostgreSQL and H2 can use the DISTINCT keyword with formal row value expressions. // [#13415] ListAgg is a special case, where the second argument is the separator - if (parens |= (args.size() > 1 && SUPPORT_DISTINCT_RVE.contains(ctx.dialect()) && !(this instanceof ListAgg))) + if (parens |= (args.size() > 1 && REQUIRE_DISTINCT_RVE.contains(ctx.dialect()) && !(this instanceof ListAgg))) ctx.sql('('); }