enforce DISTINCT+ORDERBY queries must project all ORDER BY's
also fixed eliminate duplicate operator which was broken