From cbc572427db1a3be4deffe5448f3f18233ac65f7 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Tue, 25 Jul 2023 14:30:23 +0200 Subject: [PATCH] disable some tests on MySQL due to HHH-16989 --- .../orm/test/query/hql/FunctionTests.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java index 789718340e..f6e026bc1a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java @@ -889,8 +889,6 @@ public class FunctionTests { .list(); session.createQuery("select cast(e.id as BigInteger(10)), cast(e.theDouble as BigDecimal(10,5)) from EntityOfBasics e", Object[].class) .list(); - session.createQuery("select cast(e.theString as String(15)), cast(e.theDouble as String(17)) from EntityOfBasics e", Object[].class) - .list(); session.createQuery( "select cast('1002342345234523.452435245245243' as BigDecimal) from EntityOfBasics", BigDecimal.class) .list(); @@ -1000,6 +998,7 @@ public class FunctionTests { @Test @RequiresDialectFeature( feature = DialectFeatureChecks.SupportsTruncateThroughCast.class) + @SkipForDialect(dialectClass = MySQLDialect.class, matchSubTypes = true, reason = "We need to fix this, see HHH-16989") public void testCastFunction_withTruncation(SessionFactoryScope scope) { scope.inTransaction( session -> { @@ -1019,6 +1018,18 @@ public class FunctionTests { session -> { session.createQuery("select cast(e.theString as Binary) from EntityOfBasics e", byte[].class) .list(); + } + ); + } + + @Test + @SkipForDialect(dialectClass = MySQLDialect.class, matchSubTypes = true, reason = "We need to fix this, see HHH-16989") + @SkipForDialect(dialectClass = DerbyDialect.class, reason = "Derby doesn't support casting to the binary types") + public void testCastFunctionWithLength(SessionFactoryScope scope) { + scope.inTransaction( + session -> { + session.createQuery("select cast(e.theString as String(15)), cast(e.theDouble as String(17)) from EntityOfBasics e", Object[].class) + .list(); session.createQuery("select cast(e.theString as Binary(10)) from EntityOfBasics e", byte[].class) .list(); }