[jOOQ/jOOQ#14658] Get MariaDB dialect up to date
This commit is contained in:
parent
02662afdb7
commit
a3060161b4
@ -198,6 +198,7 @@ import org.jooq.meta.jaxb.VisibilityModifier;
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.meta.postgres.PostgresRoutineDefinition;
|
||||
// ...
|
||||
import org.jooq.tools.JooqLogger;
|
||||
import org.jooq.tools.StopWatch;
|
||||
import org.jooq.tools.StringUtils;
|
||||
@ -8484,6 +8485,10 @@ public class JavaGenerator extends AbstractGenerator {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
out.println("}");
|
||||
|
||||
for (ParameterDefinition parameter : routine.getInParameters()) {
|
||||
|
||||
@ -449,6 +449,7 @@ public class DefaultDataTypeDefinition implements DataTypeDefinition {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
@ -11032,7 +11032,7 @@ public interface DSLContext extends Scope {
|
||||
* @see DSL#set(Name, Param)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL, POSTGRES, YUGABYTEDB })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
RowCountQuery set(Name name, Param<?> value);
|
||||
|
||||
/**
|
||||
|
||||
@ -1259,7 +1259,7 @@ extends
|
||||
* Create a condition to check if this field contains JSON data.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
Condition isJson();
|
||||
|
||||
/**
|
||||
@ -1268,7 +1268,7 @@ extends
|
||||
* Create a condition to check if this field does not contain JSON data.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
Condition isNotJson();
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@ -106,14 +106,14 @@ public interface InsertOnDuplicateStep<R extends Record> extends InsertReturning
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this INSERT statement.
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
InsertOnConflictDoUpdateStep<R> onConflictOnConstraint(Constraint constraint);
|
||||
|
||||
/**
|
||||
* Add a <code>ON CONFLICT ON CONSTRAINT</code> clause to this INSERT statement.
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
InsertOnConflictDoUpdateStep<R> onConflictOnConstraint(Name constraint);
|
||||
|
||||
/**
|
||||
|
||||
@ -143,7 +143,7 @@ public interface InsertQuery<R extends Record> extends StoreQuery<R>, Insert<R>,
|
||||
* <code>ON CONFLICT ON CONSTRAINT</code> clause in this <code>INSERT</code>
|
||||
* statement.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
void onConflictOnConstraint(Name constraint);
|
||||
|
||||
/**
|
||||
@ -151,7 +151,7 @@ public interface InsertQuery<R extends Record> extends StoreQuery<R>, Insert<R>,
|
||||
* <code>ON CONFLICT ON CONSTRAINT</code> clause in this <code>INSERT</code>
|
||||
* statement.
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
void onConflictOnConstraint(Constraint constraint);
|
||||
|
||||
/**
|
||||
|
||||
@ -48,6 +48,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;
|
||||
import static org.jooq.SQLDialect.YUGABYTEDB;
|
||||
|
||||
|
||||
@ -1907,7 +1907,7 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
|
||||
* @see Table#straightJoin(TableLike)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
SelectOnStep<R> straightJoin(TableLike<?> table);
|
||||
|
||||
/**
|
||||
@ -1922,7 +1922,7 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
|
||||
* @see Table#straightJoin(SQL)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
@PlainSQL
|
||||
SelectOnStep<R> straightJoin(SQL sql);
|
||||
|
||||
@ -1938,7 +1938,7 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
|
||||
* @see Table#straightJoin(String)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
@PlainSQL
|
||||
SelectOnStep<R> straightJoin(String sql);
|
||||
|
||||
@ -1955,7 +1955,7 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
|
||||
* @see Table#straightJoin(String, Object...)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
@PlainSQL
|
||||
SelectOnStep<R> straightJoin(String sql, Object... bindings);
|
||||
|
||||
@ -1972,7 +1972,7 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
|
||||
* @see Table#straightJoin(String, QueryPart...)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
@PlainSQL
|
||||
SelectOnStep<R> straightJoin(String sql, QueryPart... parts);
|
||||
|
||||
@ -1983,6 +1983,6 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
|
||||
* @see Table#straightJoin(Name)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL })
|
||||
@Support({ MARIADB, MYSQL })
|
||||
SelectOnStep<R> straightJoin(Name name);
|
||||
}
|
||||
|
||||
@ -49,6 +49,7 @@ import static org.jooq.SQLDialect.FIREBIRD;
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.YUGABYTEDB;
|
||||
import static org.jooq.XMLFormat.RecordFormat.COLUMN_NAME_ELEMENTS;
|
||||
import static org.jooq.conf.ThrowExceptions.THROW_NONE;
|
||||
@ -388,6 +389,17 @@ implements
|
||||
return executeSelectFromPOSTGRES();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Procedures (no return value) are always executed as CallableStatement
|
||||
else if (type == null) {
|
||||
return executeCallableStatement();
|
||||
@ -475,6 +487,14 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -887,6 +907,7 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
@ -1094,6 +1115,7 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
@ -1521,6 +1543,7 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
context.sql("? = ");
|
||||
}
|
||||
|
||||
@ -10013,7 +10013,7 @@ public class DSL {
|
||||
* @see DSLContext#set(Name, Param)
|
||||
*/
|
||||
@NotNull @CheckReturnValue
|
||||
@Support({ MYSQL, POSTGRES, YUGABYTEDB })
|
||||
@Support({ MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
|
||||
public static org.jooq.RowCountQuery set(Name name, Param<?> value) {
|
||||
return dsl().set(name, value);
|
||||
}
|
||||
@ -23785,7 +23785,7 @@ public class DSL {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <code>REGEXP_REPLACE_ALL</code> function.
|
||||
* Get the <code>REGEXP_REPLACE_FIRST</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES, YUGABYTEDB })
|
||||
@ -23794,7 +23794,7 @@ public class DSL {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <code>REGEXP_REPLACE_ALL</code> function.
|
||||
* Get the <code>REGEXP_REPLACE_FIRST</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ MYSQL, POSTGRES, YUGABYTEDB })
|
||||
|
||||
@ -85,6 +85,24 @@ implements
|
||||
// XXX: QueryPart API
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
final boolean parenthesised(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
@ -94,6 +112,7 @@ implements
|
||||
|
||||
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
ctx.visit(function(N_JSON_VALID, BOOLEAN, field));
|
||||
break;
|
||||
|
||||
@ -94,6 +94,7 @@ implements
|
||||
|
||||
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
ctx.visit(condition(function(N_JSON_VALID, BOOLEAN, field)).not());
|
||||
break;
|
||||
|
||||
@ -91,6 +91,31 @@ implements
|
||||
// XXX: QueryPart API
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
final boolean parenthesised(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
|
||||
|
||||
case POSTGRES:
|
||||
case YUGABYTEDB:
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case SQLITE:
|
||||
return false;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
@ -119,6 +144,10 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(DSL.field(select(jsonbArrayAgg(DSL.field(name("key")))).from("json_each({0})", field)));
|
||||
break;
|
||||
|
||||
@ -103,6 +103,9 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case SQLITE:
|
||||
return false;
|
||||
|
||||
@ -135,6 +138,10 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case SQLITE:
|
||||
ctx.visit(DSL.field(select(jsonArrayAgg(DSL.field(name("key")))).from("json_each({0})", field)));
|
||||
break;
|
||||
|
||||
@ -48,6 +48,7 @@ import static org.jooq.impl.Names.N_JSONB_OBJECT_AGG;
|
||||
import static org.jooq.impl.Names.N_JSON_GROUP_OBJECT;
|
||||
import static org.jooq.impl.Names.N_JSON_OBJECTAGG;
|
||||
import static org.jooq.impl.Names.N_JSON_OBJECT_AGG;
|
||||
import static org.jooq.impl.Names.N_OBJECT_AGG;
|
||||
import static org.jooq.impl.QOM.JSONOnNull.ABSENT_ON_NULL;
|
||||
import static org.jooq.impl.QOM.JSONOnNull.NULL_ON_NULL;
|
||||
import static org.jooq.impl.SQLDataType.BLOB;
|
||||
@ -105,6 +106,10 @@ implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case POSTGRES:
|
||||
case YUGABYTEDB:
|
||||
acceptPostgres(ctx);
|
||||
@ -162,6 +167,23 @@ implements
|
||||
acceptOverClause(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private final void acceptGroupConcat(Context<?> ctx) {
|
||||
ctx.sql('(').visit(groupConcatEmulation(ctx)).sql(')');
|
||||
}
|
||||
|
||||
@ -170,7 +170,6 @@ final class Names {
|
||||
static final Name N_JSON_TRANSFORM = systemName("json_transform");
|
||||
static final Name N_JSON_TYPE = systemName("json_type");
|
||||
static final Name N_JSON_UNQUOTE = systemName("json_unquote");
|
||||
static final Name N_JSON_VALID = systemName("json_valid");
|
||||
static final Name N_JSON_VALUE = systemName("json_value");
|
||||
static final Name N_LAG = systemName("lag");
|
||||
static final Name N_LAST_VALUE = systemName("last_value");
|
||||
@ -200,6 +199,7 @@ final class Names {
|
||||
static final Name N_NTILE = systemName("ntile");
|
||||
static final Name N_NULL = systemName("null");
|
||||
static final Name N_NVL2 = systemName("nvl2");
|
||||
static final Name N_OBJECT_AGG = systemName("object_agg");
|
||||
static final Name N_OBJECT_CONSTRUCT = systemName("object_construct");
|
||||
static final Name N_OBJECT_CONSTRUCT_KEEP_NULL = systemName("object_construct_keep_null");
|
||||
static final Name N_OFFSET = systemName("offset");
|
||||
@ -420,6 +420,7 @@ final class Names {
|
||||
static final Name N_JSON_REMOVE = systemName("json_remove");
|
||||
static final Name N_JSON_REPLACE = systemName("json_replace");
|
||||
static final Name N_JSON_SET = systemName("json_set");
|
||||
static final Name N_JSON_VALID = systemName("json_valid");
|
||||
static final Name N_LCASE = systemName("lcase");
|
||||
static final Name N_LEFT = systemName("left");
|
||||
static final Name N_LEN = systemName("len");
|
||||
@ -443,6 +444,7 @@ final class Names {
|
||||
static final Name N_NEWID = systemName("newid");
|
||||
static final Name N_NULLIF = systemName("nullif");
|
||||
static final Name N_NVL = systemName("nvl");
|
||||
static final Name N_OBJECT_KEYS = systemName("object_keys");
|
||||
static final Name N_OCTET_LENGTH = systemName("octet_length");
|
||||
static final Name N_OTRANSLATE = systemName("otranslate");
|
||||
static final Name N_OVERLAY = systemName("overlay");
|
||||
|
||||
@ -8876,6 +8876,8 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
return octetLength((Field) parseFieldParenthesised());
|
||||
else if ((field = parseFieldObjectConstructIf()) != null)
|
||||
return field;
|
||||
else if (parseFunctionNameIf("OBJECT_KEYS"))
|
||||
return parseFunctionArgs1(DSL::jsonKeys);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user