提交 48ec433e 编写于 作者: R Ryuta Kamizono

TEXT and BLOB limit is byte length, not character length.

上级 bbf0d35b
......@@ -1027,7 +1027,7 @@ def binary_to_sql(limit) # :nodoc:
when 0..0xfff; "varbinary(#{limit})"
when nil; "blob"
when 0x1000..0xffffffff; "blob(#{limit})"
else raise(ActiveRecordError, "No binary type has character length #{limit}")
else raise(ActiveRecordError, "No binary type has byte length #{limit}")
end
end
......@@ -1048,7 +1048,7 @@ def text_to_sql(limit) # :nodoc:
when nil, 0x100..0xffff; 'text'
when 0x10000..0xffffff; 'mediumtext'
when 0x1000000..0xffffffff; 'longtext'
else raise(ActiveRecordError, "No text type has character length #{limit}")
else raise(ActiveRecordError, "No text type has byte length #{limit}")
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册