1. 26 10月, 2016 1 次提交
  2. 23 10月, 2016 2 次提交
  3. 24 9月, 2016 1 次提交
  4. 14 9月, 2016 2 次提交
  5. 08 9月, 2016 1 次提交
    • D
      activerecord/mysql2: Avoid setting @connection to nil, just close it · 01adc456
      Dylan Thacker-Smith 提交于
      By doing `@connection = nil` that means that we need nil checks before it
      is used anywhere, but we weren't doing those checks.  Instead, we get a
      NoMethodError after using a connection after it fails to reconnect.
      
      Neither of the other adapters set @connection to nil, just the mysql2
      adapter. By just closing it, we avoid the need to check if we have a
      connection object and it will produce an appropriate exception when used.
      01adc456
  6. 19 8月, 2016 1 次提交
  7. 16 8月, 2016 1 次提交
  8. 07 8月, 2016 5 次提交
  9. 05 8月, 2016 1 次提交
  10. 07 6月, 2016 1 次提交
  11. 31 5月, 2016 1 次提交
    • R
      Do not include default column limit in schema.rb · 706f7e9c
      Ryuta Kamizono 提交于
      Follow up of #20815.
      
      ```ruby
      class CreatePeople < ActiveRecord::Migration[5.0]
        def change
          create_table :people do |t|
            t.integer :int
            t.bigint :bint
            t.text :txt
            t.binary :bin
          end
        end
      end
      ```
      
      Result.
      
      In postgresql and sqlite3 adapters:
      
      ```ruby
      ActiveRecord::Schema.define(version: 20160531141018) do
      
        create_table "people", force: :cascade do |t|
          t.integer "int"
          t.bigint  "bint"
          t.text    "txt"
          t.binary  "bin"
        end
      
      end
      ```
      
      In mysql2 adapter:
      
      ```ruby
      ActiveRecord::Schema.define(version: 20160531141018) do
      
        create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
          t.integer "int"
          t.bigint  "bint"
          t.text    "txt",  limit: 65535
          t.binary  "bin",  limit: 65535
        end
      
      end
      ```
      
      After this patch:
      
      ```ruby
      ActiveRecord::Schema.define(version: 20160531141018) do
      
        create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
          t.integer "int"
          t.bigint  "bint"
          t.text    "txt"
          t.binary  "bin"
        end
      
      end
      ```
      706f7e9c
  12. 24 5月, 2016 1 次提交
  13. 21 5月, 2016 1 次提交
  14. 10 5月, 2016 1 次提交
  15. 04 5月, 2016 1 次提交
  16. 30 4月, 2016 1 次提交
  17. 26 4月, 2016 1 次提交
  18. 14 4月, 2016 1 次提交
    • S
      Properly serialize all JSON primitives in the AR JSON type · efaa6e4f
      Sean Griffin 提交于
      Previously we were assuming that the only valid types for encoding were
      arrays and hashes. However, any JSON primitive is an accepted value by
      both PG and MySQL.
      
      This does involve a minor breaking change in the handling of `default`
      in the schema dumper. This is easily worked around, as passing a
      hash/array literal would have worked fine in previous versions of Rails.
      However, because of this, I will not be backporting this to 4.2 or
      earlier.
      
      Fixes #24234
      efaa6e4f
  19. 09 4月, 2016 1 次提交
    • J
      Support microsecond datetime precision on MariaDB 5.3+. · 2224d06c
      Jeremy Daer 提交于
      We support microsecond datetime precision for MySQL 5.6.4+. MariaDB has
      supported it since 5.3.0, but even 10.x versions return a compatible
      version string like `5.5.5-10.1.8-MariaDB-log` which we parse as 5.5.5,
      before MySQL supported microsecond precision.
      
      Specialize our version check to account for MariaDB to fix.
      2224d06c
  20. 05 4月, 2016 1 次提交
  21. 13 3月, 2016 1 次提交
  22. 11 3月, 2016 1 次提交
  23. 29 2月, 2016 2 次提交
    • R
      Fix `NoMethodError: undefined method `fields' for nil:NilClass` · 3cc62a97
      Ryuta Kamizono 提交于
      Currently `exec_query` raises `NoMethodError` when executing no result
      queries (`INSERT`, `UPDATE`, `DELETE`, and all DDL) in mysql2 adapter.
      
      ```
      irb(main):002:0> conn.execute("create table t(a int)")
         (43.3ms)  create table t(a int)
      => nil
      irb(main):003:0> conn.execute("insert into t values (1)")
         (19.3ms)  insert into t values (1)
      => nil
      irb(main):004:0> conn.exec_query("insert into t values (1)")
        SQL (28.6ms)  insert into t values (1)
      NoMethodError: undefined method `fields' for nil:NilClass
      ```
      3cc62a97
    • R
      Remove unnecessary namespaces in `explain_test.rb` · 1f6da4fd
      Ryuta Kamizono 提交于
      1f6da4fd
  24. 22 2月, 2016 1 次提交
  25. 01 2月, 2016 1 次提交
  26. 31 1月, 2016 1 次提交
  27. 22 1月, 2016 1 次提交
    • S
      [close #23009] Limit key length · 8897e05e
      schneems 提交于
      Mysql has a weird bug where it cannot index a string column of utf8mb4 if it is over a certain character limit. To get compatibility with msql we can add a limit to the key column. 191 characters is a very long key, it seems reasonable to limit across all adapters since using a longer key wouldn't be supported in mysql.
      
      Thanks to @kamipo for the original PR and the test refactoring.
      
      Conversation: https://github.com/rails/rails/pull/23009#issuecomment-171416629
      8897e05e
  28. 04 1月, 2016 1 次提交
  29. 27 12月, 2015 1 次提交
  30. 23 12月, 2015 1 次提交
  31. 22 12月, 2015 1 次提交
  32. 21 12月, 2015 1 次提交
  33. 18 12月, 2015 1 次提交