We're updating the issue view to help you get more done. 

hibernate.query.passDistinctThrough=false does not work when hibernate.use_sql_comments=true

Description

hibernate.query.passDistinctThrough=false hint is ignored if hibernate.use_sql_comments=true.
See attached test case.

The issue is in org.hibernate.loader.Loader.processDistinctKeyword(String, QueryParameters).
It assumes that the query string starts with 'select distinct'. However, if comments are enabled, the query will start with the comment (/..../).

Environment

None

Status

Assignee

Unassigned

Reporter

Alex Litovsky

Components

Affects versions

5.2.18

Priority

Minor