1. 02 11月, 2015 2 次提交
    • Y
      Fix test_database_created_by_root of mysql · 26967754
      yui-knk 提交于
      `DEFAULT_CHARSET` and `DEFAULT_COLLATION` in `MySQLDatabaseTasks`
      was changed by 322068fe.
      This test case also should be changed.
      26967754
    • R
      Remove `DEFAULT_CHARSET` and `DEFAULT_COLLATION` in `MySQLDatabaseTasks` · 322068fe
      Ryuta Kamizono 提交于
      This reverts commit f6ca7e4e.
      
      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.
      322068fe
  2. 19 9月, 2015 1 次提交
  3. 23 5月, 2015 1 次提交
  4. 13 5月, 2015 1 次提交
  5. 24 7月, 2014 2 次提交
    • Y
      5f25435b
    • Y
      build fix, fix error introduced with 091b246b · e63ae630
      Yves Senn 提交于
      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)
      e63ae630
  6. 16 7月, 2014 2 次提交
    • Y
      Active Record tests still depend on `capture`. Let's keep it for now. · f8f5cdc9
      Yves Senn 提交于
      This is a follow-up to 3121412c
      
      /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'
      ```
      f8f5cdc9
    • R
      3121412c
  7. 19 11月, 2013 2 次提交
  8. 18 11月, 2013 1 次提交
  9. 11 11月, 2013 1 次提交
    • J
      Explicitly exit with status "1" for create and drop failures · 22f80ae5
      Jay Hayes 提交于
      * 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
      22f80ae5
  10. 08 11月, 2013 1 次提交
  11. 18 10月, 2013 1 次提交
  12. 18 3月, 2013 1 次提交
  13. 06 3月, 2013 1 次提交
  14. 15 1月, 2013 2 次提交
  15. 12 1月, 2013 1 次提交
    • C
      Bring back "database already exists" messages when running rake tasks · 9b636dcf
      Carlos Antonio da Silva 提交于
      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.
      9b636dcf
  16. 22 9月, 2012 2 次提交
  17. 12 9月, 2012 2 次提交
  18. 06 9月, 2012 1 次提交
    • S
      Use the 'mysql' binary for 'rake db:structure:load'. · ece23b5f
      Seamus Abshere 提交于
      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.
      ece23b5f
  19. 30 7月, 2012 1 次提交
  20. 30 6月, 2012 1 次提交
  21. 24 6月, 2012 1 次提交
  22. 21 6月, 2012 1 次提交
  23. 20 6月, 2012 3 次提交
  24. 19 6月, 2012 1 次提交
    • S
      Refactor db:charset task · 363ab882
      Simon Jefford 提交于
      In a similar vein to Pat's work on create, drop etc, the db:charset
      task is now a one liner in databases.rake
      363ab882
  25. 18 6月, 2012 1 次提交
  26. 17 6月, 2012 2 次提交