reduce hash lookups and disconnect normalize_port from the options hash
eliminate nil checks in normalize_port
cache protocol on the stack to reduce options hash lookups
only pull :protocol from the options hash once
cache host on the stack so we only look it up once
remove warnings
warning: assigned but unused variable - scope_called, path and strexp
Merge pull request #15648 from kuldeepaggarwal/fix-warnings

remove warnings
remove unnecssary require of `to_param`, as `to_query` is already require `to_param`
Merge pull request #15650 from kuldeepaggarwal/remove-unecessary-require

remove unnecssary require of `to_param`, as `to_query` is already require `to_param`
Revert "remove unnecssary require of `to_param`, as `to_query` is already require `to_param`"

Revert "No need to require to_param, it is already required in to_query.rb"

This reverts commits ccdd97662e1fb00c23c90d59f65c091904959561
and d697ee14264a90a39cdbe87857656d8b314ac9b7.

Reason by @jeremy: These requires are not for implementation dependency.
They ensure that requiring array conversions provides to_query, to_param,
and other array conversion behaviors.

The fact that to_query is implemented in terms of to_param is just a
coincidence. If to_query removed its to_param require, then someone
requiring array conversions would no longer have to_param available.

This change removes these intentional dependencies on to_param in favor
of implementation side effects—an undesirable move that's susceptible to
regression.
rm `same_host?`.  The same conditional is two lines down.
Revert "rm `same_host?`.  The same conditional is two lines down."

This reverts commit 79469b4b0c05a50e19699bc9b568042add2d4987.
rm `same_host?`.  The same conditional is two lines down.
Pluck should work with columns of the same name from different tables

The column name given by the adapter doesn't include the table
namespace, so going through the hashed version of the result set causes
overridden keys.

Fixes #15649