this ticket is continuation of HHH-7119 story. There is a patch attached by Arturas Sirvinskas for the current, and, issues, however only first part was applied (since it enough to cover attached test scenario).
We are interested in the rest of the patch. I have attached maven project with test scenario which illustrates our case. The issue happens using the same parameter more than 1 time + @Filter + FetchMode.SUBSELECT.
Please review attached test (FetchingTest will pass with the entire patch from HHH-7119) and apply if it is valid case. Thank you.