[jOOQ/jOOQ#3884] Fix MULTISET predicate in SQL Server

This commit is contained in:
Lukas Eder 2021-06-25 15:30:14 +02:00
parent b86ded06e3
commit 6f17c77149
2 changed files with 20 additions and 11 deletions

View File

@ -60,7 +60,6 @@ import static org.jooq.impl.Names.N_RESULT;
import static org.jooq.impl.SQLDataType.VARCHAR;
import static org.jooq.impl.Tools.emulateMultiset;
import static org.jooq.impl.Tools.fieldName;
import static org.jooq.impl.Tools.fieldNames;
import static org.jooq.impl.Tools.map;
import static org.jooq.impl.Tools.visitSubquery;
import static org.jooq.impl.Tools.BooleanDataKey.DATA_MULTISET_CONDITION;
@ -69,6 +68,7 @@ import java.util.Set;
import org.jooq.AggregateFilterStep;
import org.jooq.Context;
import org.jooq.Field;
import org.jooq.Fields;
import org.jooq.JSON;
import org.jooq.JSONArrayAggOrderByStep;
@ -82,8 +82,6 @@ import org.jooq.Table;
import org.jooq.XML;
import org.jooq.XMLAggOrderByStep;
import org.jetbrains.annotations.NotNull;
/**
* @author Lukas Eder
*/
@ -126,6 +124,8 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> {
private final void accept0(Context<?> ctx, boolean multisetCondition) {
switch (emulateMultiset(ctx.configuration())) {
case JSON: {
Table<?> t = select.asTable("t");
switch (ctx.family()) {
@ -136,10 +136,7 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> {
default: {
Table<?> t = select.asTable("t");
JSONArrayAggOrderByStep<JSON> order;
AggregateFilterStep<JSON> filter;
@ -163,6 +160,8 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> {
}
case JSONB: {
Table<?> t = select.asTable("t");
switch (ctx.family()) {
@ -173,10 +172,7 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> {
default: {
Table<?> t = select.asTable("t");
JSONArrayAggOrderByStep<JSONB> order;
AggregateFilterStep<JSONB> filter;
@ -196,6 +192,8 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> {
}
case XML: {
Table<?> t = select.asTable("t");
switch (ctx.family()) {
@ -210,9 +208,8 @@ final class Multiset<R extends Record> extends AbstractField<Result<R>> {
default: {
Table<?> t = select.asTable("t");
default: {
XMLAggOrderByStep<XML> order;
AggregateFilterStep<XML> filter;

View File

@ -60,6 +60,7 @@ import static org.jooq.SQLDialect.MARIADB;
// ...
import static org.jooq.SQLDialect.MYSQL;
// ...
// ...
import static org.jooq.SQLDialect.POSTGRES;
// ...
// ...
@ -68,6 +69,7 @@ import static org.jooq.SQLDialect.SQLITE;
// ...
// ...
// ...
// ...
import static org.jooq.conf.BackslashEscaping.DEFAULT;
import static org.jooq.conf.BackslashEscaping.ON;
import static org.jooq.conf.ParamType.INLINED;
@ -5795,6 +5797,16 @@ final class Tools {
default:
return NestedCollectionEmulation.NATIVE;
}