Adapt right side in join if lateral detected
Fixed bug where use of :class:`.Lateral` construct in conjunction with
:meth:`.Query.join` as well as :meth:`.Query.select_entity_from` would not
apply clause adaption to the right side of the join. "lateral" introduces
the use case of the right side of a join being correlatable. Previously,
adaptation of this clause wasn't considered.
Fixes: #4334
Change-Id: I3631e562092769d30069a2aa5e50a580f4661a23
(cherry picked from commit
43f2c66ea7413cc0aaf6ca040ad33fb65ca4412d)