PASS_DISTINCT_THROUGH hint is ignored when used in conjunction with maxResults/firstResult limiters

Description

The PASS_DISTINCT_THROUGH query hint is ignored if the firstResult or maxResults query limiters are also used.

The cause is that the passDistinctThrough field of QueryParameters is not copied as part of the createCopyUsing method.

As a result, when QueryTranslatorImpl#list is invoked, and the hasLimit && containsCollectionFetches() clause is true, then the passDistinctThrough value of the original QueryParameters object is lost when createCopyUsing is called.

Environment

None

Activity

Show:
Kenny MacLeod
May 18, 2017, 1:00 AM

It's a one-line fix. Patch file attached.

Chris Cranford
June 3, 2017, 7:54 PM

would you mind supplying a quick and simple test case that outlines the problem to accompany the patch?

Vlad Mihalcea
July 17, 2017, 8:02 AM

Used test case and fixed issue as indicated.

Assignee

Chris Cranford

Reporter

Kenny MacLeod

Fix versions

Labels

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure