Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"

This reverts commit babc24c1b07c1fd58b9b3249b0256f9b0d45c0f0.

Conflicts:

	activerecord/test/cases/adapters/mysql/connection_test.rb
	activerecord/test/cases/adapters/mysql2/connection_test.rb
Preparing for 4.1.6.rc1 release
Merge pull request #16349 from jmcnevin/master

Correctly determine if migration is needed.
Fixes the digits counter of AS's NumberToRoundedConverter

Zero has one digit, but Math.log10(0) returns -Infinity. The method
needs to special-case zero.

The patch adds a regression test that is not clearly related to the
underlying issue because digit_count is private and has no coverage.
Gray area.

This bug was uncovered by 60062cf.
Merge pull request #16649 from Agis-/pg-columns-for-distinct

Fix postgresql adapter #columns_for_distinct trimming whitespace it shouldn't
CHANGELOG & improvements to #16649

* Require either FIRST or LAST qualifier for "NULLS ..."
* Require whitespace before "NULLS ..."

Conflicts:
	activerecord/CHANGELOG.md
Fixed automatic maintaining test schema to properly handle sql structure schema format.

Additionally:
* It changes `purge` task on `sqlite3` adapter to recreate database file, to
be consistent with other adapters.
* Adds `purge` step when loading from `schema.rb`

Conflicts:
	activerecord/CHANGELOG.md
	railties/test/application/test_test.rb
Merge pull request #16316 from rails/senny/purge_schema_maintenance

purge database before loading schema, take 2
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/tasks/database_tasks.rb
remove deprecation warning which is not yet issued.

This will be deprecated with `4.2`. [ci skip]
fix, mysql `db:purge` respects `Rails.env`.

Previously this method always established a connection to the test database.
This resulted in buggy behavior when combined with other tasks like
`bin/rake db:schema:load`.

This was one of the reasons why #15394 (22e9a91189af2c4e6217a888e77f22a23d3247d1)
was reverted:

> I’ve replicated it on a new app by the following commands: 1) rails
  generate model post:title, 2) rake db:migrate, 3) rake
  db:schema:load, 4) rails runner ‘puts Post.first’. The last command
  goes boom. Problem is that rake db:schema:load wipes the database,
  and then doesn’t actually restore it. This is all on MySQL. There’s
  no problem with SQLite.

  -- DHH

https://github.com/rails/rails/commit/22e9a91189af2c4e6217a888e77f22a23d3247d1#commitcomment-6834245

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #16739 from y-yagi/patch-6

[ci skip] Fix example code of ActiveRecord::FixtureSet.context_class
Fix Issue #15549, unbounded memory growth when saving records that have any after_create callbacks (or any associations, which makes after_create callbacks for you)
Trial build to see if removing @reflects_state (to fix github issue #15549) causes anything else to regress
Merge branch '4-1-stable' into reflects_state
Merge pull request #16756 from huoxito/dont-mess-railties-default-order

Dont mess with default order engines load (4.1.6.rc1 regression)
Merge pull request #16756 from huoxito/dont-mess-railties-default-order

Dont mess with default order engines load (4.1.6.rc1 regression)
Merge pull request #16795 from Peeja/methods-are-not-duplicable

Methods are not duplicable.
Conflicts:
	activesupport/CHANGELOG.md
	activesupport/test/core_ext/duplicable_test.rb
schema loading rake tasks maintain database connection for current env.

[Joshua Cody & Yves Senn]

Closes #16757.

Prior to this patch schema loading rake tasks had the potential to leak a
connection to a different database. This had side-effects when rake tasks
operating on the current connection (like `db:seed`) were chained.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/tasks/database_tasks.rb
	activerecord/test/cases/tasks/database_tasks_test.rb
Enums shouldn't ruin people's anniversaries

Added a few more methods on Module/Class to the dangerous class methods
blacklist. (Technically, allocate and new are already protected currently because
we happen to redefine them in the current implantation.)

Closes #16792
remove unnecessary arel delegation on relations, which meant that depending on what code ran first, scopes named the same as any arel method may or may not get replaced by the arel method, which may or may not show up in tests.  keep the #ast delegation as that is commonly used, write out two other calls to it, one of which was already involved in the guts of arel.  fixes the old GH issue #7421.