HQL/JPQL size() does not work (anymore) with nested expression

Description

The size() HQL/JPQL expression does not work anymore with nested path.

Given the following entities:
(TL;DR: a student can have a teacher (N - 1) a teacher can have multiple skills (N - N))

I expect the following query:

To translate into:

(this is the query generated by version 5.4.12)

While it translates into:

(since version 5.4.13 the where condition is not the good one anymore)

The subquery is comparing student.id (instead of teacher_id) against teachers_id.

I think this is related to work done in (introduction of CollectionSizeNode)

Environment

None

Assignee

George Katiforis

Reporter

Alexandre Jacob

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.4.12

Components

Affects versions

Priority

Critical
Configure