Skip to content

Remove unnecessary distinct from query in Resource::find_fragments#1225

Merged
scottgonzalez merged 1 commit intoJSONAPI-Resources:masterfrom
tommy-russoniello:remove-unnecessary-distinct
Feb 27, 2019
Merged

Remove unnecessary distinct from query in Resource::find_fragments#1225
scottgonzalez merged 1 commit intoJSONAPI-Resources:masterfrom
tommy-russoniello:remove-unnecessary-distinct

Conversation

@tommy-russoniello
Copy link
Copy Markdown
Collaborator

@tommy-russoniello tommy-russoniello commented Feb 27, 2019

SELECT queries ordering by fields not being selected cannot be distinct in most newer versions of databases. This can potentially cause a database error such as one like this for MySQL:

Expression #1 of ORDER BY clause is not in SELECT list, references column 'some_database.users.name' which is not in SELECT list; this is incompatible with DISTINCT

All Submissions:

  • I've checked to ensure there aren't other open Pull Requests for the same update/change.
  • I've submitted a ticket for my issue if one did not already exist.
  • My submission passes all tests. (Please run the full test suite locally to cut down on noise from travis failures.)
  • I've used Github auto-closing keywords in the commit message or the description.
  • I've added/updated tests for this change.

New Feature Submissions:

  • I've submitted an issue that describes this feature, and received the go ahead from the maintainers.
  • My submission includes new tests.
  • My submission maintains compliance with JSON:API.

Bug fixes and Changes to Core Features:

  • I've included an explanation of what the changes do and why I'd like you to include them.
  • I've provided test(s) that fails without the change.

Test Plan:

Reviewer Checklist:

  • Maintains compliance with JSON:API
  • Adequate test coverage exists to prevent regressions

Copy link
Copy Markdown
Contributor

@lgebhardt lgebhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@scottgonzalez scottgonzalez merged commit 469d452 into JSONAPI-Resources:master Feb 27, 2019
@tommy-russoniello tommy-russoniello deleted the remove-unnecessary-distinct branch February 27, 2019 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants