When running Hibernate Reactive’s [ManyToManyTest|https://github.com/hibernate/hibernate-reactive/blob/wip/ORM-6/hibernate-reactive-core/src/test/java/org/hibernate/reactive/ManyToManyTest.java] , the test fails with:
{noformat}java.util.concurrent.CompletionException: org.hibernate.HibernateException: java.util.concurrent.CompletionException: io.vertx.pgclient.PgException: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list (42P10){noformat}
The problematic part is [this|https://github.com/hibernate/hibernate-reactive/blob/wip/ORM-6/hibernate-reactive-core/src/test/java/org/hibernate/reactive/ManyToManyTest.java#L53] which leads to the following generated SQL:
{code:sql} select distinct a1_0.id, b1_0.Author_id, b1_1.id, b1_1.title, a1_0.name from MTMAuthor a1_0 left join (MTMAuthor_MTMBook b1_0 join MTMBook b1_1 on b1_1.id = b1_0.books_id) on a1_0.id = b1_0.Author_id order by b1_0.books_id{code}
The test worked just fine in Hibernate Reactive’s main branch (using ORM 5.5)
A discussion of the issue can also be found [here|https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev/topic/Hibernate.20ORM.206.20migration/near/326889626]. |
|