diff options
-rw-r--r-- | activerecord/CHANGELOG.md | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index f33d38b35a..a8a7ff3a81 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,7 @@ +* MySQL: correct LONGTEXT and LONGBLOB limits from 2GB to their true 4GB. + + *Jeremy Kemper* + * SQLite3Adapter now checks for views in `table_exists?`. Fixes #14041. *Girish Sonawane* diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index e72055c9e9..e601d0c516 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -650,8 +650,8 @@ module ActiveRecord m.register_type %r(tinyblob)i, Type::Binary.new(limit: 255) m.register_type %r(mediumtext)i, Type::Text.new(limit: 16777215) m.register_type %r(mediumblob)i, Type::Binary.new(limit: 16777215) - m.register_type %r(longtext)i, Type::Text.new(limit: 2147483647) - m.register_type %r(longblob)i, Type::Binary.new(limit: 2147483647) + m.register_type %r(longtext)i, Type::Text.new(limit: 2**32 - 1) + m.register_type %r(longblob)i, Type::Binary.new(limit: 2**32 - 1) m.register_type %r(^bigint)i, Type::Integer.new(limit: 8) m.register_type %r(^int)i, Type::Integer.new(limit: 4) m.register_type %r(^mediumint)i, Type::Integer.new(limit: 3) diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index d5584ad06c..79fad06565 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -219,11 +219,11 @@ class SchemaDumperTest < ActiveRecord::TestCase assert_match %r{t.binary\s+"tiny_blob",\s+limit: 255$}, output assert_match %r{t.binary\s+"normal_blob"$}, output assert_match %r{t.binary\s+"medium_blob",\s+limit: 16777215$}, output - assert_match %r{t.binary\s+"long_blob",\s+limit: 2147483647$}, output + assert_match %r{t.binary\s+"long_blob",\s+limit: 4294967295$}, output assert_match %r{t.text\s+"tiny_text",\s+limit: 255$}, output assert_match %r{t.text\s+"normal_text"$}, output assert_match %r{t.text\s+"medium_text",\s+limit: 16777215$}, output - assert_match %r{t.text\s+"long_text",\s+limit: 2147483647$}, output + assert_match %r{t.text\s+"long_text",\s+limit: 4294967295$}, output end def test_schema_dumps_index_type |