Are you sure this affects 5.1.8? As far as I remember, there are some problems related to implicit joins in the on clause that I just fixed for 5.2.8. In 5.1 this shouldn't even be possible.