instance method
extract_limit
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v3.1.12 PrivateSignature
extract_limit(sql_type)
No documentation comment.
Parameters
-
sql_typereq
Source
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 61
def extract_limit(sql_type)
case sql_type
when /blob|text/i
case sql_type
when /tiny/i
255
when /medium/i
16777215
when /long/i
2147483647 # mysql only allows 2^31-1, not 2^32-1, somewhat inconsistently with the tiny/medium/normal cases
else
super # we could return 65535 here, but we leave it undecorated by default
end
when /^bigint/i; 8
when /^int/i; 4
when /^mediumint/i; 3
when /^smallint/i; 2
when /^tinyint/i; 1
else
super
end
end
Defined in activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb line 61
· View on GitHub
· Improve this page
· Find usages on GitHub