aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/tasks/mysql_rake_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplicated testutilum2017-01-021-8/+0
| | | | | b8f74860b61782e3b949ade3bb51bff40899e89b provided a nicer version of `#test_structure_load` but the old version was not removed.
* Merge pull request #27437 from kirs/structure-load-dump-flagsKasper Timm Hansen2016-12-291-0/+40
|\ | | | | Make ActiveRecord structure load/dump configurable
| * Make ActiveRecord structure load/dump configurableKir Shatrov2016-12-221-0/+40
| | | | | | | | | | | | | | | | Without this patch it's impossible to pass extra flags to mysqldump/pg_dump when running `rake db:structure:dump` or `load` The following config variables (`structure_load_flags` and `structure_dump_flags`) make it better configurable.
* | assert_equal takes expectation firstAkira Matsuda2016-12-261-3/+3
|/
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-259/+259
|
* modernizes hash syntax in activerecordXavier Noria2016-08-061-5/+5
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-45/+45
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #23301 from ppworks/improve_mysqldumpArthur Nogueira Neves2016-06-171-4/+4
|\ | | | | Improve mysqldump
| * Skip comments when exec mysqldumpNaoto Koshikawa2016-01-281-4/+4
| |
* | Fix isolated test failures due to referencing ↵Jeremy Daer2016-04-181-0/+1
| | | | | | | | ActiveRecord::Tasks::DatabaseAlreadyExists before another test happened to make it available
* | Added notice when a database is successfully created or dropped.bogdanvlviv2016-04-171-4/+36
|/
* Remove legacy mysql adapterRyuta Kamizono2015-12-211-75/+72
| | | | Follow up to #22642.
* Remove legacy mysql adapterAbdelkader Boudih2015-12-171-12/+12
|
* Fix test_database_created_by_root of mysqlyui-knk2015-11-021-1/+1
| | | | | | `DEFAULT_CHARSET` and `DEFAULT_COLLATION` in `MySQLDatabaseTasks` was changed by 322068fe85278ea26e26da6dfd7c5612dab15a72. This test case also should be changed.
* Remove `DEFAULT_CHARSET` and `DEFAULT_COLLATION` in `MySQLDatabaseTasks`Ryuta Kamizono2015-11-021-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f6ca7e4e75408bc42f515fc7206d6c6ff0dce7c6. The default collation of utf8 in MySQL is the `utf8_general_ci`, and this should not be changed. This is because, the better collation in the all locales is not exists, optimal collation in own application is not known other than themselves. The `utf8_unicode_ci` is known as Japanese killer in Japan, there are serious impacts in search of Japanese. MySQL implements the `utf8_unicode_ci` according to the Unicode Collation Algorithm (UCA) described at http://www.unicode.org/reports/tr10/, but the `utf8_unicode_ci` have only partial support for the UCA, only primary level key comparison implemented (also known as L1 (Base characters) comparison). Because L1 (Base characters) comparison does not distinguish between the presence or absence of the accent, if distinction of the accent is important there is a serious impact (e.g. Japanese). Example: ``` > SHOW CREATE TABLE `dicts`\G *************************** 1. row *************************** Table: dicts Create Table: CREATE TABLE `dicts` ( `word` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `meaning` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci 1 row in set (0.00 sec) > INSERT INTO `dicts` VALUES ('ハハ', 'mother'), ('パパ', 'father'); Query OK, 2 rows affected (0.00 sec) > SELECT * FROM `dicts` WHERE `word` = 'ハハ'; +--------+---------+ | word | meaning | +--------+---------+ | ハハ | mother | | パパ | father | +--------+---------+ 2 rows in set (0.00 sec) > CREATE UNIQUE INDEX `unique_index_word` ON `dicts`(`word`); ERROR 1062 (23000): Duplicate entry 'ハハ' for key 'unique_index_word' ``` We should omit the collation entirely rather than providing a default. Then the choice is the responsibility of the server and MySQL distribution.
* Merge pull request #20569 from theSteveMitchell/masterYves Senn2015-09-221-6/+8
|\ | | | | | | Check mysql structure_load for errors
| * Check response of structure_load for mysql_database_tasks and make ↵Steve Mitchell2015-09-181-3/+16
|/ | | | structure_dump consistent
* Changed mysqldump to include sprocs and functionsJonathan Worek2015-05-221-4/+4
|
* Add full set of MySQL CLI options to support SSL authentication when using ↵Alex Coomans2015-05-121-1/+10
| | | | db:structure dump and load
* tests, run adapter specific rake tests only for the right adapter.Yves Senn2014-07-241-0/+2
|
* build fix, fix error introduced with 091b246bb0111357edbb9703ea342a944b04deb6Yves Senn2014-07-241-2/+2
| | | | | | | | | | | | | | Fixes the following issue: 1) Failure: ActiveRecord::MySQLPurgeTest#test_establishes_connection_to_test_database [test/cases/tasks/mysql_rake_test.rb:200]: not all expectations were satisfied unsatisfied expectations: - expected exactly once, not yet invoked: ActiveRecord::Base.establish_connection(:test) satisfied expectations: - allowed any number of times, invoked once: #<Mock:0x2349430>.recreate_database(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.establish_connection(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.connection(any_parameters)
* Active Record tests still depend on `capture`. Let's keep it for now.Yves Senn2014-07-161-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 3121412 /cc @rafaelfranca This will remove deprecation warnings from the PostgreSQL suite: ``` DEPRECATION WARNING: #capture(stream) is deprecated and will be removed in the next release. (called from capture at /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89) /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89:in `capture' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:73:in `ensure_warning_is_issued' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:48:in `test_column' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:106:in `block (3 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:204:in `capture_exceptions' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:103:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:256:in `time_it' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:102:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:276:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:101:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:759:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:293:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:287:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `each' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:306:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:285:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `block in __run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `map' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `__run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:126:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:55:in `block in autorun' ```
* Keep quietly and capture undeprecated on your suiteRafael Mendonça França2014-07-151-0/+19
|
* Revert "Properly require database tasks so we have access to the raised ↵Rafael Mendonça França2013-11-191-1/+0
| | | | | | | | constant" This reverts commit fbcd46b1a0d255a34d29caa77bbd31c287446333. This is not needed anymore. See 7280965
* Revert "Explicitly exit with status "1" for create and drop failures"Rafael Mendonça França2013-11-191-3/+1
| | | | | | | | | | This reverts commit 22f80ae57b26907f662b7fd50a7270a6381e527e. See https://github.com/rails/rails/commit/22f80ae57b26907f662b7fd50a7270a6381e527e#commitcomment-4640676 Conflicts: activerecord/CHANGELOG.md
* Properly require database tasks so we have access to the raised constantCarlos Antonio da Silva2013-11-171-0/+1
| | | | Fix travis failures.
* Merge pull request #12531 from iamvery/database-tasks-exit-statusRafael Mendonça França2013-11-151-1/+3
|\ | | | | | | | | | | | | Explicitly exit with status "1" for create and drop task failures Conflicts: activerecord/CHANGELOG.md
| * Explicitly exit with status "1" for create and drop failuresJay Hayes2013-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A non-zero exit status allows subsequent shell commands to be chained together such as: `rake db:reset test:prepare && rspec && cap deploy` (if you're feeling brave :) * Any exceptions raised during the `create` and `drop` tasks are caught in order to print a "pretty" message to the user. Unfortunately doing so prevents rake from aborting with a non-zero exit status to the shell. * Therefore we re-raise the exceptions after the "pretty" message and re-catch them in the task. * From the task we explicitly exit with a non-zero status. This method was chosen (rather than just letting rake fail from the exception) so that the backtrace is suppressed and the output to stderr is unchanged. * Update activerecord CHANGELOG
* | Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-75/+74
| | | | | | | | | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* | Convert Fixnum into String the port number in MySQLKenta Okamoto2013-10-181-0/+9
|/
* `rake db:create` does not change permissions of root user.Yves Senn2013-03-171-2/+18
| | | | | | | | Closes #8079. I had to rework some of the tests because the mock allowed any arguments for `connection.exeucte`. I think this is very dangerous as there could anything be executed without the tests noticing it.
* rake db:structure:dump warns when `mysqldump` is not in PATH.Yves Senn2013-03-061-1/+12
| | | | | | | | Closes #9518. The rake task used to fail silently and left an empty `structure.sql`. It's confusing for users to get to the root of the problem. The warning message tells them where to look.
* Revert "Merge pull request #8942 from yahonda/tested_only_with_mysql"Carlos Antonio da Silva2013-01-151-4/+0
| | | | | | | | | | | This reverts commit 1fc294f988e93ac59057a16b0e44b9cf93af9720, reversing changes made to fb9ac47c286fbdfe05263d4d0346e50892090603. Reason: these tests should run fine independent of database, since they should only take into account the configuration options. The problem was related to a change in the way "nil" is handled by the rescue clause, in Ruby 2.0 it raises an exception asking for class or module, in 1.9 it passes.
* Address test_create_when_database_exists_outputs_info_to_stderr failuresYasuo Honda2013-01-151-0/+4
| | | | | When tested with ruby-2.0.0-rc1 `rake test` executes this test even if the target adapter is not mysql nor mysql2.
* Bring back "database already exists" messages when running rake tasksCarlos Antonio da Silva2013-01-121-0/+10
| | | | | | | | | | When running tasks such "rake db:setup", instead of showing messages like "db_development already exists", it was showing a big stack trace and a message "Couldn't create database for ..." with the configuration options, a very confusing message with a big trace. This brings back the functionality present in 3-2, showing the same message.
* Style: remove hash noiseJeremy Kemper2012-09-211-10/+10
|
* Correct default charset/collation for mysql dbsJeremy Kemper2012-09-211-9/+21
|
* Use configuration['encoding'], because database configuration use not ↵kennyj2012-09-121-2/+2
| | | | charset but encoding.
* Use native mysqldump command for 'rake db:structure:dump'.kennyj2012-09-121-15/+2
|
* Use the 'mysql' binary for 'rake db:structure:load'.Seamus Abshere2012-09-051-5/+2
| | | | The previous implementation had the strange requirement that db/structure.sql contain only CREATE TABLE sql statements, one per table, separated by double newlines. SQLite3 and PostgreSQL database tasks, on the other hand, simply spawn 'sqlite3' and 'psql' binaries to load the file directly. The new implementation follows this and attempts to respect all current MySQL configuration settings.
* fix incorrect usage `require mysql` in the ↵Vladimir Strakhov2012-07-291-1/+5
| | | | activerecord/test/.../mysql_rake_test.rb
* Extract collation tasks to database tasks.kennyj2012-07-011-0/+18
|
* Move tasks(rake) tests to under the tasks dir.kennyj2012-06-241-0/+246