From d23fc129cc007ddd41a97eb6feea8f6f8a07d6f8 Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Wed, 18 Jul 2018 15:45:17 +0200 Subject: [PATCH] HHH-12825 CriteriaHQLAlignmentTest.testCountReturnValues fails on databases that don't support tuple distinct counts because it expects wrong exception --- .../org/hibernate/test/hql/CriteriaHQLAlignmentTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java index c1f3d8d80c..365c044077 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java @@ -280,6 +280,15 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase { throw ex; } } + catch (PersistenceException e) { + SQLGrammarException cause = assertTyping( SQLGrammarException.class, e.getCause() ); + if ( ! getDialect().supportsTupleCounts() ) { + // expected + } + else { + throw e; + } + } finally { t.rollback(); s.close();