From b267964f94be8dd23c4edd56b56137cdc68e5e25 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 14 May 2020 17:42:55 +0200 Subject: [PATCH] [jOOQ/jOOQ#10178] Special treatment for DISTINCT with subqueries --- jOOQ/src/main/java/org/jooq/impl/RowIsDistinctFrom.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/RowIsDistinctFrom.java b/jOOQ/src/main/java/org/jooq/impl/RowIsDistinctFrom.java index 68cf8ec48a..88d9a3bec9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/RowIsDistinctFrom.java +++ b/jOOQ/src/main/java/org/jooq/impl/RowIsDistinctFrom.java @@ -53,6 +53,7 @@ import static org.jooq.SQLDialect.MARIADB; // ... import static org.jooq.SQLDialect.MYSQL; // ... +import static org.jooq.SQLDialect.POSTGRES; // ... // ... import static org.jooq.SQLDialect.SQLITE; @@ -88,7 +89,8 @@ final class RowIsDistinctFrom extends AbstractCondition { // An emulation may be required only for the version where a subquery is used // E.g. in HSQLDB: https://sourceforge.net/p/hsqldb/bugs/1579/ - private static final Set EMULATE_DISTINCT_SELECT = SQLDialect.supportedBy(HSQLDB); + // Or in PostgreSQL: https://twitter.com/pg_xocolatl/status/1260344255035379714 + private static final Set EMULATE_DISTINCT_SELECT = SQLDialect.supportedBy(HSQLDB, POSTGRES); private static final Set SUPPORT_DISTINCT_WITH_ARROW = SQLDialect.supportedBy(MARIADB, MYSQL); private final Row lhs;