Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL doesn't support the NULLS FIRST/LAST clause in ORDER BY statements #10624

Closed
phillipleblanc opened this issue May 22, 2024 · 0 comments · Fixed by #10625
Closed

MySQL doesn't support the NULLS FIRST/LAST clause in ORDER BY statements #10624

phillipleblanc opened this issue May 22, 2024 · 0 comments · Fixed by #10625
Labels
bug Something isn't working

Comments

@phillipleblanc
Copy link
Contributor

Describe the bug

When unparsing LogicalPlans back to SQL statements for the MySQL dialect, any plan that includes a Sort node will produce a SQL statement that looks like:

SELECT "ta"."j1_id" FROM "j1" AS "ta" ORDER BY "ta"."j1_id" ASC NULLS LAST LIMIT 10
                                                                ^--------^              

The NULLS LAST causes issues when run against a MySQL server, as it doesn't recognize that syntax.

To Reproduce

Create an Unparser with a MySQL dialect, unparse any plan that includes a Sort node and observe that the SQL string generated includes the NULLS FIRST/LAST clause.

Expected behavior

The MySQL dialect should omit writing out the NULLS LAST clause, since its not a supported feature of the DB.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant