Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
32ea84df
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
32ea84df
编写于
11月 21, 2016
作者:
R
Ryuta Kamizono
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix that unsigned with zerofill is treated as signed
Fixes #27125.
上级
747ddd34
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
2 deletion
+9
-2
activerecord/CHANGELOG.md
activerecord/CHANGELOG.md
+6
-0
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
...tive_record/connection_adapters/abstract_mysql_adapter.rb
+1
-1
activerecord/lib/active_record/connection_adapters/mysql/column.rb
...ord/lib/active_record/connection_adapters/mysql/column.rb
+1
-1
activerecord/test/cases/adapters/mysql2/unsigned_type_test.rb
...verecord/test/cases/adapters/mysql2/unsigned_type_test.rb
+1
-0
未找到文件。
activerecord/CHANGELOG.md
浏览文件 @
32ea84df
*
Fix that unsigned with zerofill is treated as signed.
Fixes #27125.
*Ryuta Kamizono*
*
Fix the uniqueness validation scope with a polymorphic association.
*Sergey Alekseev*
...
...
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
浏览文件 @
32ea84df
...
...
@@ -693,7 +693,7 @@ def initialize_type_map(m) # :nodoc:
def
register_integer_type
(
mapping
,
key
,
options
)
# :nodoc:
mapping
.
register_type
(
key
)
do
|
sql_type
|
if
/\bunsigned\
z
/
.
match?
(
sql_type
)
if
/\bunsigned\
b
/
.
match?
(
sql_type
)
Type
::
UnsignedInteger
.
new
(
options
)
else
Type
::
Integer
.
new
(
options
)
...
...
activerecord/lib/active_record/connection_adapters/mysql/column.rb
浏览文件 @
32ea84df
...
...
@@ -5,7 +5,7 @@ class Column < ConnectionAdapters::Column # :nodoc:
delegate
:extra
,
to: :sql_type_metadata
,
allow_nil:
true
def
unsigned?
/\bunsigned\z
/
.
match?
(
sql_type
)
!
/\A(?:enum|set)\b/
.
match?
(
sql_type
)
&&
/\bunsigned\b
/
.
match?
(
sql_type
)
end
def
case_sensitive?
...
...
activerecord/test/cases/adapters/mysql2/unsigned_type_test.rb
浏览文件 @
32ea84df
...
...
@@ -48,6 +48,7 @@ class UnsignedType < ActiveRecord::Base
t
.
unsigned_bigint
:unsigned_bigint_t
t
.
unsigned_float
:unsigned_float_t
t
.
unsigned_decimal
:unsigned_decimal_t
,
precision:
10
,
scale:
2
t
.
column
:unsigned_zerofill
,
"int unsigned zerofill"
end
@connection
.
columns
(
"unsigned_types"
).
select
{
|
c
|
/^unsigned_/
.
match?
(
c
.
name
)
}.
each
do
|
column
|
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录