File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,7 @@ def visit_Arel_Nodes_Concat(o, collector)
2929 visit o . right , collector
3030 end
3131
32- # def visit_Arel_Nodes_UpdateStatement(o, collector)
33- # if has_join_and_composite_primary_key?(o)
34- # update_statement_using_join(o, collector)
35- # else
36- # o.limit = Nodes::Limit.new(9_223_372_036_854_775_807) if o.orders.any? && o.limit.nil?
37- #
38- # super
39- # end
40- # end
41-
32+ # Same as SQLite and PostgreSQL.
4233 def visit_Arel_Nodes_UpdateStatement ( o , collector )
4334 collector . retryable = false
4435 o = prepare_update_statement ( o )
@@ -84,12 +75,8 @@ def visit_Arel_Nodes_UpdateStatement(o, collector)
8475 maybe_visit o . limit , collector
8576 end
8677
87- # In the simple case, PostgreSQL allows us to place FROM or JOINs directly into the UPDATE
88- # query. However, this does not allow for LIMIT, OFFSET and ORDER. To support
89- # these, we must use a subquery.
78+ # Same as PostgreSQL except we need to add limit if using subquery.
9079 def prepare_update_statement ( o )
91-
92-
9380 if has_join_sources? ( o ) && !has_limit_or_offset_or_orders? ( o ) && !has_group_by_and_having? ( o )
9481 o
9582 else
You can’t perform that action at this time.
0 commit comments