diff options
author | Edouard CHIN <edouard.chin@shopify.com> | 2017-06-21 13:54:14 -0400 |
---|---|---|
committer | Edouard CHIN <edouard.chin@shopify.com> | 2017-06-21 13:54:14 -0400 |
commit | bed0fa8a88d8d51acb7d6084db76ab1cce7ecccc (patch) | |
tree | b1b40c2fa703ebcc73b9e5c7d9005ee22d83656c /activerecord/test/cases/tasks | |
parent | 9cf7217909c30e5513f668e5c8aa105b04ba35fd (diff) | |
download | rails-bed0fa8a88d8d51acb7d6084db76ab1cce7ecccc.tar.gz rails-bed0fa8a88d8d51acb7d6084db76ab1cce7ecccc.tar.bz2 rails-bed0fa8a88d8d51acb7d6084db76ab1cce7ecccc.zip |
pass `structure_dump_flags` / `structure_load_flags` options before any other:
- On Mysql, some command line options that affect option-file handling such as `--no-defaults` have to be passed before any other options
- Modified rails to pass them right after the `mysql` command
- Ref https://dev.mysql.com/doc/refman/5.7/en/option-file-options.html and https://bugs.mysql.com/bug.php?id=83386
- Ref #27437
Diffstat (limited to 'activerecord/test/cases/tasks')
-rw-r--r-- | activerecord/test/cases/tasks/mysql_rake_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/tasks/mysql_rake_test.rb b/activerecord/test/cases/tasks/mysql_rake_test.rb index c22d974536..9c6fb14376 100644 --- a/activerecord/test/cases/tasks/mysql_rake_test.rb +++ b/activerecord/test/cases/tasks/mysql_rake_test.rb @@ -296,7 +296,7 @@ if current_adapter?(:Mysql2Adapter) def test_structure_dump_with_extra_flags filename = "awesome-file.sql" - expected_command = ["mysqldump", "--result-file", filename, "--no-data", "--routines", "--skip-comments", "--noop", "test-db"] + expected_command = ["mysqldump", "--noop", "--result-file", filename, "--no-data", "--routines", "--skip-comments", "test-db"] assert_called_with(Kernel, :system, expected_command, returns: true) do with_structure_dump_flags(["--noop"]) do @@ -364,7 +364,7 @@ if current_adapter?(:Mysql2Adapter) def test_structure_load filename = "awesome-file.sql" - expected_command = ["mysql", "--execute", %{SET FOREIGN_KEY_CHECKS = 0; SOURCE #{filename}; SET FOREIGN_KEY_CHECKS = 1}, "--database", "test-db", "--noop"] + expected_command = ["mysql", "--noop", "--execute", %{SET FOREIGN_KEY_CHECKS = 0; SOURCE #{filename}; SET FOREIGN_KEY_CHECKS = 1}, "--database", "test-db"] assert_called_with(Kernel, :system, expected_command, returns: true) do with_structure_load_flags(["--noop"]) do |