提交 4ec5b0d6 编写于 作者: S Sean Griffin

Properly lookup the limit for bigint

Fixes #18787.
上级 35d77130
......@@ -453,7 +453,12 @@ def extract_precision(sql_type) # :nodoc:
end
def extract_limit(sql_type) # :nodoc:
$1.to_i if sql_type =~ /\((.*)\)/
case sql_type
when /^bigint/i
8
when /\((.*)\)/
$1.to_i
end
end
def translate_exception_class(e, sql)
......
......@@ -79,6 +79,11 @@ def test_integer_types
assert_lookup_type :integer, 'bigint'
end
def test_bigint_limit
cast_type = @connection.type_map.lookup("bigint")
assert_equal 8, cast_type.limit
end
def test_decimal_without_scale
types = %w{decimal(2) decimal(2,0) numeric(2) numeric(2,0) number(2) number(2,0)}
types.each do |type|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册