Fix multiple database support for DATABASE_URL env variable
#36756

seejohnrun wants to merge seejohnrun:env-urls-with-multiple-databases into rails:master

We do not currently have an analysis of these two commits