From 27d422384ad7a2ef28439df3ef775795cb0e2ecd Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 21 Feb 2020 10:48:32 +0100 Subject: [PATCH] [jOOQ/jOOQ#7421] [jOOQ/jOOQ#9832] Revert removal of FROM DUAL in MySQL Newer versions of MariaDB and MySQL can do without FROM clause, so our "FROM dual" clause is no longer needed. There are some use cases in the jOOQ Open Source Edition (e.g. code generator), where wrong SQL is thus generated on MySQL 5.7. Thus, we'll postpone this improvement until we have a better solution. --- jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java index 3b25782eff..2d25ffcd71 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java @@ -72,11 +72,9 @@ import static org.jooq.SQLDialect.HSQLDB; // ... import static org.jooq.SQLDialect.MARIADB; // ... -// ... import static org.jooq.SQLDialect.MYSQL; // ... // ... -// ... import static org.jooq.SQLDialect.POSTGRES; // ... // ... @@ -218,7 +216,9 @@ final class SelectQueryImpl extends AbstractResultQuery imp static final Set SUPPORT_WINDOW_CLAUSE = SQLDialect.supportedBy(H2, MYSQL, POSTGRES); - private static final Set REQUIRES_FROM_CLAUSE = SQLDialect.supportedUntil(CUBRID, DERBY, FIREBIRD, HSQLDB); + + // [#7421] [#9832] We can eventually stop generating the FROM clause in newer versions of MariaDB and MySQL + private static final Set REQUIRES_FROM_CLAUSE = SQLDialect.supportedBy(CUBRID, DERBY, FIREBIRD, HSQLDB, MARIADB, MYSQL); private static final Set REQUIRES_DERIVED_TABLE_DML = SQLDialect.supportedBy(MARIADB, MYSQL); private static final Set EMULATE_EMPTY_GROUP_BY_OTHER = SQLDialect.supportedBy(FIREBIRD, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE); private static final Set SUPPORT_FULL_WITH_TIES = SQLDialect.supportedBy(H2);