fixing update_all and delete_all when chained with left_joins
#27193

plentz wants to merge plentz:master into rails:master

We do not currently have an analysis of these two commits