Revert "Merge pull request #10539 from davidcelis/ar-sql-improvements"
Revert "Merge pull request #10539 from davidcelis/ar-sql-improvements"

This reverts commit 257fa6897d9c85da16b7c9fcb4ae3008198d320e, reversing
changes made to 94725b81f5588e4b0f43222c4f142c3135941b4b.

The build failed

https://travis-ci.org/rails/rails/builds/7883546

schuetzm/rails,ttanimichi/rails,prathamesh-sonpatki/rails,stefanmb/rails,kirs/rails-1,palkan/rails,vassilevsky/rails,gavingmiller/rails,tjschuck/rails,Stellenticket/rails,mechanicles/rails,mtsmfm/railstest,Stellenticket/rails,bolek/rails,voray/rails,ngpestelos/rails,EmmaB/rails-1,xlymian/rails,bolek/rails,assain/rails,bolek/rails,travisofthenorth/rails,riseshia/railsguides.kr,yalab/rails,arunagw/rails,illacceptanything/illacceptanything,printercu/rails,jeremy/rails,yahonda/rails,repinel/rails,bogdanvlviv/rails,gavingmiller/rails,samphilipd/rails,kddeisz/rails,koic/rails,flanger001/rails,lcreid/rails,notapatch/rails,schuetzm/rails,prathamesh-sonpatki/rails,hanystudy/rails,rbhitchcock/rails,shioyama/rails,vassilevsky/rails,MSP-Greg/rails,yahonda/rails,georgeclaghorn/rails,fabianoleittes/rails,Sen-Zhang/rails,maicher/rails,kirs/rails-1,untidy-hair/rails,mathieujobin/reduced-rails-for-travis,schuetzm/rails,repinel/rails,yalab/rails,maicher/rails,vipulnsward/rails,arunagw/rails,utilum/rails,kenta-s/rails,jeremy/rails,Edouard-chin/rails,yhirano55/rails,illacceptanything/illacceptanything,mtsmfm/railstest,mtsmfm/rails,mohitnatoo/rails,Vasfed/rails,kaspth/rails,elfassy/rails,elfassy/rails,rails/rails,MichaelSp/rails,marklocklear/rails,vassilevsky/rails,yawboakye/rails,arjes/rails,pvalena/rails,yalab/rails,jeremy/rails,starknx/rails,notapatch/rails,tgxworld/rails,assain/rails,yahonda/rails,Edouard-chin/rails,kmcphillips/rails,kddeisz/rails,88rabbit/newRails,kaspth/rails,bradleypriest/rails,MSP-Greg/rails,kmcphillips/rails,starknx/rails,fabianoleittes/rails,amoody2108/TechForJustice,pvalena/rails,Edouard-chin/rails,Spin42/rails,untidy-hair/rails,arjes/rails,Spin42/rails,bogdanvlviv/rails,mijoharas/rails,assain/rails,BlakeWilliams/rails,coreyward/rails,mtsmfm/rails,eileencodes/rails,Envek/rails,utilum/rails,joonyou/rails,yawboakye/rails,prathamesh-sonpatki/rails,Envek/rails,stefanmb/rails,pschambacher/rails,MSP-Greg/rails,voray/rails,betesh/rails,kamipo/rails,88rabbit/newRails,yawboakye/rails,notapatch/rails,felipecvo/rails,sergey-alekseev/rails,kddeisz/rails,amoody2108/TechForJustice,iainbeeston/rails,baerjam/rails,EmmaB/rails-1,kenta-s/rails,schuetzm/rails,tgxworld/rails,richseviora/rails,ledestin/rails,betesh/rails,lcreid/rails,aditya-kapoor/rails,gfvcastro/rails,Erol/rails,hanystudy/rails,printercu/rails,Stellenticket/rails,notapatch/rails,kddeisz/rails,BlakeWilliams/rails,koic/rails,arjes/rails,xlymian/rails,mechanicles/rails,shioyama/rails,fabianoleittes/rails,yhirano55/rails,rafaelfranca/omg-rails,BlakeWilliams/rails,arunagw/rails,kamipo/rails,tjschuck/rails,kaspth/rails,kmayer/rails,vipulnsward/rails,brchristian/rails,travisofthenorth/rails,yalab/rails,iainbeeston/rails,Spin42/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,repinel/rails,matrinox/rails,betesh/rails,EmmaB/rails-1,palkan/rails,utilum/rails,brchristian/rails,kachick/rails,amoody2108/TechForJustice,aditya-kapoor/rails,rbhitchcock/rails,mtsmfm/railstest,yasslab/railsguides.jp,gcourtemanche/rails,joonyou/rails,ttanimichi/rails,shioyama/rails,bogdanvlviv/rails,mijoharas/rails,shioyama/rails,mijoharas/rails,mechanicles/rails,richseviora/rails,iainbeeston/rails,illacceptanything/illacceptanything,alecspopa/rails,kmayer/rails,marklocklear/rails,lcreid/rails,mathieujobin/reduced-rails-for-travis,88rabbit/newRails,joonyou/rails,hanystudy/rails,pschambacher/rails,printercu/rails,vipulnsward/rails,illacceptanything/illacceptanything,vipulnsward/rails,betesh/rails,palkan/rails,sealocal/rails,jeremy/rails,esparta/rails,rails/rails,gfvcastro/rails,Envek/rails,deraru/rails,alecspopa/rails,eileencodes/rails,aditya-kapoor/rails,georgeclaghorn/rails,Edouard-chin/rails,esparta/rails,starknx/rails,joonyou/rails,coreyward/rails,illacceptanything/illacceptanything,alecspopa/rails,BlakeWilliams/rails,gauravtiwari/rails,lucasmazza/rails,flanger001/rails,gavingmiller/rails,richseviora/rails,yawboakye/rails,MSP-Greg/rails,arunagw/rails,deraru/rails,tgxworld/rails,marklocklear/rails,Erol/rails,eileencodes/rails,printercu/rails,kenta-s/rails,illacceptanything/illacceptanything,sergey-alekseev/rails,mohitnatoo/rails,odedniv/rails,repinel/rails,untidy-hair/rails,Sen-Zhang/rails,fabianoleittes/rails,yahonda/rails,gauravtiwari/rails,yhirano55/rails,deraru/rails,flanger001/rails,matrinox/rails,prathamesh-sonpatki/rails,bogdanvlviv/rails,palkan/rails,samphilipd/rails,kamipo/rails,tijwelch/rails,baerjam/rails,illacceptanything/illacceptanything,xlymian/rails,stefanmb/rails,tijwelch/rails,voray/rails,travisofthenorth/rails,mohitnatoo/rails,sealocal/rails,Erol/rails,kirs/rails-1,assain/rails,kmcphillips/rails,tjschuck/rails,gcourtemanche/rails,maicher/rails,koic/rails,tijwelch/rails,Vasfed/rails,Envek/rails,pschambacher/rails,illacceptanything/illacceptanything,lucasmazza/rails,mohitnatoo/rails,Stellenticket/rails,sergey-alekseev/rails,gfvcastro/rails,aditya-kapoor/rails,rbhitchcock/rails,MichaelSp/rails,eileencodes/rails,gfvcastro/rails,ledestin/rails,elfassy/rails,Sen-Zhang/rails,Vasfed/rails,illacceptanything/illacceptanything,kmayer/rails,bradleypriest/rails,ngpestelos/rails,ledestin/rails,mtsmfm/rails,kachick/rails,georgeclaghorn/rails,flanger001/rails,ngpestelos/rails,tjschuck/rails,lucasmazza/rails,illacceptanything/illacceptanything,odedniv/rails,samphilipd/rails,rails/rails,riseshia/railsguides.kr,riseshia/railsguides.kr,rossta/rails,rafaelfranca/omg-rails,lcreid/rails,travisofthenorth/rails,rossta/rails,pvalena/rails,felipecvo/rails,gcourtemanche/rails,sealocal/rails,yhirano55/rails,untidy-hair/rails,felipecvo/rails,odedniv/rails,pvalena/rails,mechanicles/rails,baerjam/rails,riseshia/railsguides.kr,matrinox/rails,gauravtiwari/rails,Vasfed/rails,illacceptanything/illacceptanything,ttanimichi/rails,rafaelfranca/omg-rails,illacceptanything/illacceptanything,esparta/rails,kmcphillips/rails,brchristian/rails,illacceptanything/illacceptanything,yasslab/railsguides.jp,tgxworld/rails,utilum/rails,yasslab/railsguides.jp,yasslab/railsguides.jp,bradleypriest/rails,rossta/rails,kachick/rails,georgeclaghorn/rails,coreyward/rails,mathieujobin/reduced-rails-for-travis,deraru/rails,esparta/rails,MichaelSp/rails,iainbeeston/rails,rails/rails,Erol/rails,baerjam/rails