TEIID-3143 fixing class cast on clone
TEIID-3144 validating against unrelated correlated subqueries in the
order by clause