You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The original code in https://github.com/rails/rails/blob/v7.1.5.1/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L1404-L1406
212
-
# ----
213
-
# limited_ids = select_rows(limited.arel, "SQL").map do |results|
214
-
# results.last(Array(relation.primary_key).length) # ignores order values for MySQL and PostgreSQL
215
-
# end
216
-
# ----
217
-
# The change is needed because in Oracle, because otherwise the resulting `limited_ids` array would be wrong. For example,
218
-
# for a ServiceContract model that has the primary key "id" and a query with ordering and filtering you may get:
219
-
# 1. `limited` variable can be something like: #<ActiveRecord::Relation [#<ServiceContract alias_0__: "live", id: 4, raw_rnum_: 1>]>
220
-
# 2. `select_rows` would then return [["live",4,1]]
221
-
# 3. `limited_ids` calculation will result in [[1]], which is an invalid IDs list (the expected is [[4]])
222
-
# The updated code doesn't make assumptions about how many columns are selected or their order, but fetches the values according
0 commit comments