Changes corresponding to changes in Rails 4.1 to support MySQL 5.7.3.

Commit in ActiveRecord: https://github.com/rails/rails/commit/b6655885ef13cf8d1705dc9b5232846f0207febd: