提交 4da96789 编写于 作者: R Ryuta Kamizono

Remove needless `case_insensitive_comparison` in mysql2 adapter

Simply it is sufficient to override `can_perform_case_insensitive_comparison_for?`.
上级 39b1dd1c
......@@ -398,7 +398,7 @@ def case_insensitive_comparison(table, attribute, column, value)
if can_perform_case_insensitive_comparison_for?(column)
table[attribute].lower.eq(table.lower(Arel::Nodes::BindParam.new))
else
case_sensitive_comparison(table, attribute, column, value)
table[attribute].eq(Arel::Nodes::BindParam.new)
end
end
......
......@@ -615,13 +615,10 @@ def case_sensitive_comparison(table, attribute, column, value)
end
end
def case_insensitive_comparison(table, attribute, column, value)
if column.case_sensitive?
super
else
table[attribute].eq(Arel::Nodes::BindParam.new)
end
def can_perform_case_insensitive_comparison_for?(column)
column.case_sensitive?
end
private :can_perform_case_insensitive_comparison_for?
# In MySQL 5.7.5 and up, ONLY_FULL_GROUP_BY affects handling of queries that use
# DISTINCT and ORDER BY. It requires the ORDER BY columns in the select list for
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册