Support MySQL 5.7.25 in specs

Specs fail in EE master when running using MySQL 5.7.25, as seen in https://gitlab.com/gitlab-org/gitlab-ee/issues/9323:

Failures:

  1) MigrateImportAttributesDataFromProjectsToProjectMirrorData#down schedules delayed background migrations in batches in bulk for rollback
     Failure/Error: import_state.create!(id: 1, project_id: 1, status: :started)

     ActiveRecord::StatementInvalid:
       Mysql2::Error: Field 'next_execution_timestamp' doesn't have a default value: INSERT INTO `project_mirror_data` (`project_id`, `id`, `status`) VALUES (1, 1, 'started')
     # ./config/initializers/connection_fix.rb:20:in `execute'
     # ./config/initializers/active_record_locking.rb:14:in `_create_record'
     # ./spec/migrations/migrate_import_attributes_data_from_projects_to_project_mirror_data_spec.rb:38:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Mysql2::Error:
     #   Field 'next_execution_timestamp' doesn't have a default value
     #   ./config/initializers/connection_fix.rb:20:in `execute'

I think the specs counted on a bug in MySQL 5.7.24, from the mysql 5.7.25 changelog: https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-25.html

CREATE TABLE ... SELECT could create date columns with “zero” date default values when it should have created them without a default value. (Bug #28022129)

In https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9252 we've fixed the MySQL version to 5.7.24 in order to get master green. But we should probably support that MySQL patch release.

Assignee Loading
Time tracking Loading