diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java index 26158aff94..1f24fd3efe 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MariaDBDialect.java @@ -33,6 +33,7 @@ import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry; import org.hibernate.type.descriptor.sql.internal.DdlTypeImpl; import org.hibernate.type.descriptor.sql.spi.DdlTypeRegistry; +import static org.hibernate.query.sqm.produce.function.FunctionParameterType.NUMERIC; import static org.hibernate.type.SqlTypes.OTHER; import static org.hibernate.type.SqlTypes.UUID; @@ -87,6 +88,11 @@ public class MariaDBDialect extends MySQLDialect { .resolve( StandardBasicTypes.BOOLEAN ) ); commonFunctionFactory.inverseDistributionOrderedSetAggregates_windowEmulation(); + queryEngine.getSqmFunctionRegistry().patternDescriptorBuilder( "median", "median(?1) over ()" ) + .setInvariantType( queryEngine.getTypeConfiguration().getBasicTypeRegistry().resolve( StandardBasicTypes.DOUBLE ) ) + .setExactArgumentCount( 1 ) + .setParameterTypes(NUMERIC) + .register(); } @Override diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java index 842c1a8de1..f8594d70df 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java @@ -470,7 +470,8 @@ abstract public class DialectFeatureChecks { public boolean apply(Dialect dialect) { return !( dialect instanceof MySQLDialect || dialect instanceof SybaseDialect - || dialect instanceof DerbyDialect ); + || dialect instanceof DerbyDialect ) + || dialect instanceof MariaDBDialect; } } }