Invalid SQL produced when using FetchMode.SUBSELECT with SQLServerDialect

Description

For example, enabling org.hibernate.test.subselect.CompositeIdTypeBindingTest for SQL-Server by removing the corresponding annotation @SkipForDialect and running the matrix-test on an SQL-Server would produce the following exception.

This is due to execution of this SQL-statement which is invalid for SQL-Server:

Environment

SQL-Server 2012

Activity

Show:
Tobias Brueggemann
April 7, 2016, 10:35 AM
Edited

After applying the attached patch-file the test will pass. The SQL-statement (for SQL-Server only) then looks like:

The attached patch-file also introduces a new test-case org.hibernate.test.subselectfetch.compositeid.SubselectFetchCompositeIdTest derived from org.hibernate.test.subselectfetch.SubselectFetchTest and a test-case org.hibernate.test.subselectfetch.multilevel.MultiLevelTest that would fail on SQL-Server without applying the patch.

Benjamin Runnels
October 27, 2017, 2:06 PM

I can confirm this is still happening in Hibernate 5.2.10.Final

Assignee

Unassigned

Reporter

Tobias Brueggemann

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure