Doctrine 1

Using ->limit() in conjunction with many-to-many with mysql generates wrong SQL