Skip to content

columns_for_distinct might need some adjustments #2482

@joaquinco

Description

@joaquinco

I'm facing some issues when this method is called (OracleEnhancedAdapter#columns_for_distinct(columns, orders)) with Rails 8.0.4.

In particual the two issues I see are:

  1. Since Rails 7.1 added support for composite primary keys the first attribute is (can be) a list of columns which is interpolated as is into the SQL query resulting in invalid syntax
  2. It's not stripping out "NULLS FIRST" or "NULLS LAST" from the order by clauses, also resulting in invalid syntax

I think the first issue can be solved by joinin columns by a comma and the latter by copying postgres' solution.

I can create a PR later when I have time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions