GEOT-4554: Joining generates SQL with empty ON()