HINT_PASS_DISTINCT_THROUGH does not work if 'hibernate.use_sql_comments' property is enabled

Description

the hint 'HINT_PASS_DISTINCT_THROUGH' does not take effect if the 'hibernate.use_sql_comments' property is enabled.
This happens because the 'org.hibernate.loader.Loader.processDistinctKeyword(...)' method checks the condition 'sql.startsWith( SELECT_DISTINCT )' in order to perform the 'distinct' keyword removal. If the 'hibernate.use_sql_comments' is enabled the comments precede the 'distinct' keyword and aforementioned condition check fails.

Environment

None

Assignee

Unassigned

Reporter

Former user

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.7

Components

Affects versions

Priority

Minor
Configure