Support MySQL 5.7 explain
Remove `DEFAULT NULL` for primary key column to support MySQL 5.7.3

Since MySQL 5.7.3 m13 does now allow primary key column is null.
Merge pull request #13247 from yahonda/support_mysql573_primary_key

From http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-3.html:
"Columns in a PRIMARY KEY must be NOT NULL, but if declared explicitly as NULL produced no error. Now an error occurs."
Merge pull request #13248 from yahonda/support_mysql573_explain

Support MySQL 5.7 explain
Fix warnings on mysql2 explain test
doc: date/conversions.rb should talk about date format not time format.

Closes #13245.

[ci skip]
Simplify @responses hash initialization

@responses hash needs to be initialized with mime types that we get from
Collector#collect_mimes_from_class_level. Mime::Type class as key and nil as
value. This need to happen before content negotiation. Before that, it was
looping though mime types and executing mime-type-generated method inside
collector (see
AbstractController::Collector#generate_method_for_mime). That approach resulted
in 2 unnecessary method calls for each mime type
collected by Collector#collect_mimes_from_class_level.

Now hash is initialized in place, without usage of Collector#custom method.
Inline variants syntax

In most cases, when setting variant specific code, you're not sharing any code
within format.

Inline syntax can vastly simplify defining variants in those situations:

  respond_to do |format|
    format.js { render "trash" }
    format.html do |variant|
      variant.phone { redirect_to progress_path }
      variant.none  { render "trash" }
    end
  end

Becomes:

  respond_to do |format|
    format.js         { render "trash" }
    format.html.phone { redirect_to progress_path }
    format.html.none  { render "trash" }
  end
Fix type cast on group sum with custom expression

For PG adapters with custom expression and grouped result
of aggregate functions have not found correct column type
for it. Extract column type from query result.

Closes: #13230
Merge pull request #13236 from jetthoughts/13230_type_cast_bug_in_agr_functions

Fix type cast on group sum with custom expression
make `collect_deprecations` available.

There are circumstances where the capabilities of `assert_deprecated` and
`assert_not_deprecated` are not enough. For example if a ccertain call-path
raises two deprecations but should only raise a single one.

This module is still :nodoc and intented for internal use.

/cc @rafaelfranca
Merge pull request #13253 from strzalek/variants-inline2

Variants inline syntax v2
Rename not Ruby files to .tt
Replace with gsub! in ActiveSupport::Inflector.
Merge pull request #13257 from eshira/optimize-gsub

Replace with gsub! in ActiveSupport::Inflector
Fix typo in docs, missing colon in Symbol literal [ci skip]
Merge pull request #13258 from semaperepelitsa/docs

Fix typo in docs, missing colon in Symbol literal
Revert "Rename not Ruby files to .tt"

This reverts commit bd360ad3c1d59273bf96ea01b17cf04285816dc2.

Reverting this for now until we fix the Thor related issue
Fix mounting engines inside a resources block

When a route is mounted inside a resources block, it's automatically
prefixed, so a following code:

    resources :users do
      mount Blog::Engine => '/blog'
    end

will generate a user_blog path helper.

In order to access engine helpers, we also use "mounted_helpers", a list
of helpers associated with each mounted engine, so a path to blog's post
can be generated using user_blog.post_path(user, post).

The problem I'm fixing here is that mount used a raw :as option, without
taking nestings into account. As a result, blog was added to a route set
as a `user_blog`, but helper was generated for just `blog`.

This commit applies the proper logic for defining a helper for a mounted
engine nested in resources or resource block.

(closes #8533)
Merge pull request #12699 from drogus/fix-mounting-engine-in-resources

Fix mounting engines inside a resources block