Backported #7572 to 3-2-stable. Use config['encoding'], because database configuration use not charset but encoding.
Merge pull request #7603 from kennyj/fix_charset_vs_encoding_32

Backported #7572 to 3-2-stable. Use config['encoding'], because database configuration use not charset but encoding.
Backport PostgreSQL auto-reconnect test coverage

6d5f4de4c420ebb906109668f5702a537ac77692
Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests.

4b1bca04025a66c54e6e9d5eb6e4d4056bfa92f0
Stop being silly with formatting of method aliasing.

c381d5cbf959208adeb38e7859ee815dfbd2cf54
Fix just-plain-wrongness of psql auto-reconnect test.

1e17a9d367c54c680368be72f44247ae28b98904
Fix only-once stub logic.

f16c2043826ec1991cf94fe17cb671507b7a7f51
Changelog for PostgreSQL auto-reconnect test coverage backport.
Merge pull request #7632 from stevecj/3-2-stable

3 2 stable
fix markdown markup in AR/CHANGELOG
Merge pull request #7633 from frodsan/patch-5

Fix markdown markup in AR/CHANGELOG [ci skip]
`skip` in Ruby 1.8 doesn't skip the test case without return
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