aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeremy Kemper <jeremykemper@gmail.com>2014-09-10 14:01:52 -0700
committerJeremy Kemper <jeremykemper@gmail.com>2014-09-10 15:35:12 -0700
commit39303c0221d6854387c0e9038551e8e6d4533239 (patch)
tree97f35691c0ec43c054b9bae6ee74f99bfc2aaa0e /activerecord
parent467e5700e6c759276406d8dc3604ede2c86235cb (diff)
downloadrails-39303c0221d6854387c0e9038551e8e6d4533239.tar.gz
rails-39303c0221d6854387c0e9038551e8e6d4533239.tar.bz2
rails-39303c0221d6854387c0e9038551e8e6d4533239.zip
MySQL: correct LONGTEXT and LONGBLOB limits from 2GB to their true 4GB
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md4
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb4
-rw-r--r--activerecord/test/cases/schema_dumper_test.rb4
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