提交 330c6af0 编写于 作者: S Sean Griffin

Merge pull request #23736 from kamipo/remove_needless_case_insensitive_comparison_in_mysql2_adapter

Remove needless `case_insensitive_comparison` in mysql2 adapter
...@@ -398,7 +398,7 @@ def case_insensitive_comparison(table, attribute, column, value) ...@@ -398,7 +398,7 @@ def case_insensitive_comparison(table, attribute, column, value)
if can_perform_case_insensitive_comparison_for?(column) if can_perform_case_insensitive_comparison_for?(column)
table[attribute].lower.eq(table.lower(Arel::Nodes::BindParam.new)) table[attribute].lower.eq(table.lower(Arel::Nodes::BindParam.new))
else else
case_sensitive_comparison(table, attribute, column, value) table[attribute].eq(Arel::Nodes::BindParam.new)
end end
end end
......
...@@ -615,13 +615,10 @@ def case_sensitive_comparison(table, attribute, column, value) ...@@ -615,13 +615,10 @@ def case_sensitive_comparison(table, attribute, column, value)
end end
end end
def case_insensitive_comparison(table, attribute, column, value) def can_perform_case_insensitive_comparison_for?(column)
if column.case_sensitive? column.case_sensitive?
super
else
table[attribute].eq(Arel::Nodes::BindParam.new)
end
end 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 # 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 # 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.
先完成此消息的编辑!
想要评论请 注册