Backport explain fixes.

* Mark as SCHEMA some schema database queries. #7648
* Don't explain queries except normal CRUD sql. #7657

Closes #6458
Closes #7544
Merge pull request #7651 from steveklabnik/issue_3956

Don't preserve SELECT columns on COUNT

Closes #7651

Conflicts:
	activerecord/test/cases/associations/has_many_associations_test.rb
Merge pull request #7666 from kennyj/fix_9fa3f102813eeeec440abd75870dfa7b23835665

Fix warning: method redefine. Testcase name are duplicated.
Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmt

Fix collection= on hm:t join models when unsaved
log 404 status when ActiveRecord::RecordNotFound was raised (#7646)

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_controller/log_subscriber.rb
backport fair connection pool 02b2335563 to 3-2-stable
Merge pull request #7675 from jrochkind/fair_conn_pool_backport

backport fair connection pool 02b2335563 to 3-2-stable
Respect `config.digest = false` for `asset_path`

Previously, the `asset_path` internals only respected the `:digest`
option, but ignored the global config setting. This meant that
`config.digest = false` could not be used in conjunction with
`config.compile = false` this corrects the behavior.
Merge pull request #7672 from wagenet/asset_path_digest_fix

Respect `config.digest = false` for `asset_path`
Add upgrading note to 3.1 release notes.

See #7685.
Merge pull request #7686 from steveklabnik/add_upgrade_note

Add upgrading note to 3.1 release notes.
Making test accurately reflect what is going on in the schema migrations test
Cache columns metadata to avoid extra while testing
Merge pull request #7668 from Draiken/fix_issue_6497

Removing to_shorthand to fix #6497
Conflicts:
	actionpack/CHANGELOG.md
Load the environment after creating the database

Conflicts:
	activerecord/lib/active_record/railties/databases.rake
Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings.
Merge pull request #7718 from kennyj/fix_6962-32

[3-2-stable] Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings.
Revert "backport fair connection pool 02b2335563 to 3-2-stable"

This reverts commit 0693e079708a52b777f2b7872b8e3d467b880a0d.

Revert "Cache columns metadata to avoid extra while testing"

This reverts commit a82f1e3f5d11c8dfba9f4c911745ec40a7965216.

Reason: This is causing failures in the postgresql build.
See http://travis-ci.org/#!/rails/rails/builds/2485584

Related with #7675
Revert "Respect `config.digest = false` for `asset_path`"

This reverts commit 1ac19c11792a745cd654f02dfaed8e93f95b3c70.

Conflicts:
	actionpack/CHANGELOG.md

Reason: This is causing failures in the railties build.
See http://travis-ci.org/#!/rails/rails/jobs/2491787

Related with #7672
Explictly set the assets digest option to false