Make remote_ip detection properly handle private IPv6 addresses

Fixes #12638.
SQLite3: Always close statements.

SQLite3 adapter must make sure to close statements after queries.

Fixes: #13631
Stringify variables names for mysql connections

For mysql2/mysql adapters, `sql_mode` variable name set in `database.yml`
as string, was ignored and `sql_mode` was set to use strict mode.

Fixes #14895
[skip ci] Document: required `via` option in `match` routing method.
Add documentation to select_tag for :selected option
Merge pull request #14922 from rizwanreza/add-selected-documentation-to-select-tag

Add documentation to select_tag for :selected option
Avoid unnecessary conditional block

GeneratedAttribute#column_name checks already for reference? on the
attribute returning the right name to use as symbol for label and field.
Merge pull request #14928 from potomak/update-scaffold-form-template

Avoid unnecessary conditional block
Merge pull request #13640 from maginatics/fix_sqlite3_ensure_master

SQLite3: Always close statements.

Conflicts:
	activerecord/CHANGELOG.md
Remove unused variable
Merge pull request #12651 from cespare/ipv6-remote-ip-fixes

Make remote_ip detection properly handle private IPv6 addresses

Conflicts:
	actionpack/CHANGELOG.md
Merge pull request #14915 from juanpastas/patch-1

Update mapper.rb
[ci skip] Security guide clarity.
Merge pull request #14931 from heironimus/security_guide_clarity

[ci skip] Security guide clarity.
always use File.join
Merge pull request #14932 from phoet/use_file_join

always use File.join in asset_path
Merge pull request #14896 from jetthoughts/14895_overide_strict_by_sql_mode

Symbolize variables of mysql/mysql2 connection configuration

Conflicts:
	activerecord/CHANGELOG.md
never merge url options in to the first data hash

if you want options, don't mix them with the first hash, just pass them
all in with the second hash
always pass options to the _url method
only add the optiosn if they are not empty

I think this is wrong, but it gets the build passing for now. We should
always add options, but we need to make more guarantees about how the
underlying url helper is called