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)
29
29
visit o . right , collector
30
30
end
31
31
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.
42
33
def visit_Arel_Nodes_UpdateStatement ( o , collector )
43
34
collector . retryable = false
44
35
o = prepare_update_statement ( o )
@@ -84,12 +75,8 @@ def visit_Arel_Nodes_UpdateStatement(o, collector)
84
75
maybe_visit o . limit , collector
85
76
end
86
77
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.
90
79
def prepare_update_statement ( o )
91
-
92
-
93
80
if has_join_sources? ( o ) && !has_limit_or_offset_or_orders? ( o ) && !has_group_by_and_having? ( o )
94
81
o
95
82
else
You can’t perform that action at this time.
0 commit comments