[jOOQ/jOOQ#12102] Add support for MariaDB 10.6
This commit is contained in:
parent
0b90e7a90f
commit
8e77eece10
@ -42,6 +42,7 @@ import org.jetbrains.annotations.*;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
@ -59,7 +60,7 @@ public interface JSONTableColumnForOrdinalityStep {
|
||||
* <code>COLUMNS</code> clause of the <code>JSON_TABLE</code> predicate.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnsStep forOrdinality();
|
||||
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ import org.jetbrains.annotations.*;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
@ -59,7 +60,7 @@ public interface JSONTableColumnPathStep extends JSONTableColumnForOrdinalitySte
|
||||
* clause of the <code>JSON_TABLE</code> predicate.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnsStep path(String path);
|
||||
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ import org.jetbrains.annotations.*;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
@ -59,7 +60,7 @@ public interface JSONTableColumnsFirstStep {
|
||||
* <code>JSON_TABLE</code> expression.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnForOrdinalityStep column(String name);
|
||||
|
||||
/**
|
||||
@ -67,7 +68,7 @@ public interface JSONTableColumnsFirstStep {
|
||||
* <code>JSON_TABLE</code> expression.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnForOrdinalityStep column(Name name);
|
||||
|
||||
/**
|
||||
@ -75,7 +76,7 @@ public interface JSONTableColumnsFirstStep {
|
||||
* <code>JSON_TABLE</code> expression.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnPathStep column(Field<?> name);
|
||||
|
||||
/**
|
||||
@ -83,7 +84,7 @@ public interface JSONTableColumnsFirstStep {
|
||||
* <code>JSON_TABLE</code> expression.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnPathStep column(String name, DataType<?> type);
|
||||
|
||||
/**
|
||||
@ -91,7 +92,7 @@ public interface JSONTableColumnsFirstStep {
|
||||
* <code>JSON_TABLE</code> expression.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnPathStep column(Name name, DataType<?> type);
|
||||
|
||||
/**
|
||||
@ -99,7 +100,7 @@ public interface JSONTableColumnsFirstStep {
|
||||
* <code>JSON_TABLE</code> expression.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
JSONTableColumnPathStep column(Field<?> name, DataType<?> type);
|
||||
|
||||
}
|
||||
|
||||
@ -213,6 +213,14 @@ public enum SQLDialect {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ import org.jetbrains.annotations.*;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
// ...
|
||||
@ -141,6 +142,6 @@ public interface SelectForUpdateWaitStep<R extends Record> extends SelectForStep
|
||||
* @see SelectQuery#setForLockModeSkipLocked()
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
SelectForStep<R> skipLocked();
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@ import static org.jooq.SQLDialect.MARIADB;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
// ...
|
||||
@ -1200,7 +1201,7 @@ public interface SelectQuery<R extends Record> extends Select<R>, ConditionProvi
|
||||
* Depending on the dialect and lock mode this flag may or may not be
|
||||
* supported.
|
||||
*/
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
void setForLockModeSkipLocked();
|
||||
|
||||
|
||||
|
||||
@ -67,6 +67,7 @@ import static org.jooq.SQLDialect.MARIADB;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
// ...
|
||||
@ -23246,7 +23247,7 @@ public class DSL {
|
||||
* The JSON table function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
public static JSONTableColumnsFirstStep jsonTable(JSON json, String path) {
|
||||
return jsonTable(Tools.field(json), Tools.field(path));
|
||||
}
|
||||
@ -23255,7 +23256,7 @@ public class DSL {
|
||||
* The JSON table function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
public static JSONTableColumnsFirstStep jsonTable(Field<JSON> json, Field<String> path) {
|
||||
return new JSONTable(Tools.nullSafe(json), Tools.nullSafe(path));
|
||||
}
|
||||
@ -23264,7 +23265,7 @@ public class DSL {
|
||||
* The JSON table function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
public static JSONTableColumnsFirstStep jsonbTable(JSONB json, String path) {
|
||||
return jsonbTable(Tools.field(json), Tools.field(path));
|
||||
}
|
||||
@ -23273,7 +23274,7 @@ public class DSL {
|
||||
* The JSON table function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES })
|
||||
public static JSONTableColumnsFirstStep jsonbTable(Field<JSONB> json, Field<String> path) {
|
||||
return new JSONTable(Tools.nullSafe(json), Tools.nullSafe(path));
|
||||
}
|
||||
|
||||
@ -451,6 +451,7 @@ final class InsertQueryImpl<R extends Record> extends AbstractStoreQuery<R> impl
|
||||
|
||||
|
||||
|
||||
|
||||
case MYSQL:
|
||||
case MARIADB: {
|
||||
toSQLInsert(ctx);
|
||||
|
||||
@ -39,6 +39,7 @@ package org.jooq.impl;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
// ...
|
||||
@ -75,9 +76,7 @@ import org.jooq.Name;
|
||||
// ...
|
||||
import org.jooq.Record;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.SelectField;
|
||||
import org.jooq.TableOptions;
|
||||
import org.jooq.conf.ParamType;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
@ -86,7 +85,7 @@ final class JSONTable
|
||||
extends AbstractTable<Record>
|
||||
implements
|
||||
JSONTableColumnPathStep {
|
||||
private static final Set<SQLDialect> REQUIRES_COLUMN_PATH = SQLDialect.supportedBy(MYSQL);
|
||||
private static final Set<SQLDialect> REQUIRES_COLUMN_PATH = SQLDialect.supportedBy(MARIADB, MYSQL);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -168,6 +168,7 @@ final class Limit extends AbstractQueryPart {
|
||||
case DERBY:
|
||||
case FIREBIRD:
|
||||
case H2:
|
||||
case MARIADB:
|
||||
case POSTGRES: {
|
||||
|
||||
// [#8415] For backwards compatibility reasons, we generate standard
|
||||
@ -276,7 +277,6 @@ final class Limit extends AbstractQueryPart {
|
||||
|
||||
|
||||
// [#4785] OFFSET cannot be without LIMIT
|
||||
case MARIADB:
|
||||
|
||||
|
||||
|
||||
|
||||
@ -77,6 +77,9 @@ final class MetaSQL {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -117,6 +120,8 @@ final class MetaSQL {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -155,6 +160,8 @@ final class MetaSQL {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -329,7 +329,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
|
||||
|
||||
|
||||
private static final Set<SQLDialect> SUPPORT_FULL_WITH_TIES = SQLDialect.supportedBy(H2, POSTGRES);
|
||||
private static final Set<SQLDialect> SUPPORT_FULL_WITH_TIES = SQLDialect.supportedBy(H2, MARIADB, POSTGRES);
|
||||
private static final Set<SQLDialect> EMULATE_DISTINCT_ON = SQLDialect.supportedBy(DERBY, FIREBIRD, HSQLDB, MARIADB, MYSQL, SQLITE);
|
||||
static final Set<SQLDialect> NO_SUPPORT_FOR_UPDATE_OF_FIELDS = SQLDialect.supportedBy(MYSQL, POSTGRES);
|
||||
|
||||
@ -1767,7 +1767,6 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
|
||||
case CUBRID:
|
||||
case FIREBIRD:
|
||||
case MARIADB:
|
||||
case MYSQL: {
|
||||
if (getLimit().isApplicable() && getLimit().withTies())
|
||||
toSQLReferenceLimitWithWindowFunctions(context);
|
||||
@ -3824,7 +3823,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
// [#12328] Don't recurse into the RHS if the join does not affect the projection
|
||||
j -> j.type != JoinType.LEFT_ANTI_JOIN && j.type != JoinType.LEFT_SEMI_JOIN,
|
||||
null,
|
||||
|
||||
|
||||
// TODO: PostgreSQL supports tables without columns, see e.g.
|
||||
// https://blog.jooq.org/creating-tables-dum-and-dee-in-postgresql/
|
||||
(r, t) -> r && t.fieldsRow().size() > 0
|
||||
|
||||
@ -392,6 +392,8 @@ public class JDBCUtils {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return MARIADB;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user