[jOOQ/jOOQ#13509] MariaDB is also affected

This commit is contained in:
Lukas Eder 2022-05-04 15:36:10 +02:00
parent 51ba61d336
commit 7c6618833c

View File

@ -41,7 +41,7 @@ import static java.lang.Boolean.TRUE;
// ...
// ...
import static org.jooq.SQLDialect.MYSQL;
// ...
import static org.jooq.SQLDialect.*;
import static org.jooq.SQLDialect.POSTGRES;
import static org.jooq.SQLDialect.YUGABYTEDB;
import static org.jooq.impl.DSL.function;
@ -114,9 +114,10 @@ import org.jooq.XMLAggOrderByStep;
*/
final class Multiset<R extends Record> extends AbstractField<Result<R>> implements QOM.Multiset<R> {
static final Set<SQLDialect> NO_SUPPORT_JSON_COMPARE = SQLDialect.supportedBy(POSTGRES, YUGABYTEDB);
static final Set<SQLDialect> NO_SUPPORT_JSONB_COMPARE = SQLDialect.supportedBy();
static final Set<SQLDialect> NO_SUPPORT_XML_COMPARE = SQLDialect.supportedBy(POSTGRES);
static final Set<SQLDialect> NO_SUPPORT_JSON_COMPARE = SQLDialect.supportedBy(POSTGRES, YUGABYTEDB);
static final Set<SQLDialect> NO_SUPPORT_JSONB_COMPARE = SQLDialect.supportedBy();
static final Set<SQLDialect> NO_SUPPORT_XML_COMPARE = SQLDialect.supportedBy(POSTGRES);
static final Set<SQLDialect> FORCE_LIMIT_IN_DERIVED_TABLE = SQLDialect.supportedBy(MARIADB, MYSQL);
final Select<R> select;
@ -153,7 +154,7 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> implemen
private final void accept0(Context<?> ctx, boolean multisetCondition) {
switch (emulateMultiset(ctx.configuration())) {
case JSON: {
Table<?> t = new AliasedSelect<>(select, true, false, ctx.family() == MYSQL, fieldNames(select.getSelect().size())).as(DSL.name("t"), (Name[]) null);
Table<?> t = new AliasedSelect<>(select, true, false, FORCE_LIMIT_IN_DERIVED_TABLE.contains(ctx.dialect()), fieldNames(select.getSelect().size())).as(DSL.name("t"), (Name[]) null);
switch (ctx.family()) {
@ -206,7 +207,7 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> implemen
}
case JSONB: {
Table<?> t = new AliasedSelect<>(select, true, false, ctx.family() == MYSQL, fieldNames(select.getSelect().size())).as(DSL.name("t"), (Name[]) null);
Table<?> t = new AliasedSelect<>(select, true, false, FORCE_LIMIT_IN_DERIVED_TABLE.contains(ctx.dialect()), fieldNames(select.getSelect().size())).as(DSL.name("t"), (Name[]) null);
switch (ctx.family()) {
@ -261,7 +262,7 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> implemen
case XML: {
List<Field<?>> fields = select.getSelect();
Table<?> t = new AliasedSelect<>(select, true, false, ctx.family() == MYSQL, fieldNames(fields.size())).as(DSL.name("t"), (Name[]) null);
Table<?> t = new AliasedSelect<>(select, true, false, FORCE_LIMIT_IN_DERIVED_TABLE.contains(ctx.dialect()), fieldNames(fields.size())).as(DSL.name("t"), (Name[]) null);
switch (ctx.family()) {