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

MyXQL: Add back subquery parens inside of function calls #643

Merged

Conversation

greg-rychlewski
Copy link
Member

Closes #642

This was removed when subquery support was added to order by/group by. I believe it was because stuff like exists((..subquery...)) looked weird and not necessarily because it breaks the query. All my local tests passed and all our integration tests pass, including the ones added when this change was made.

I opted for adding the parens back because the other option is to special case certain functions. Which I think can get hairy.

@josevalim
Copy link
Member

Should we add a test with the coalesce example in #642?

@greg-rychlewski greg-rychlewski merged commit 6e7a49e into elixir-ecto:master Oct 18, 2024
11 checks passed
@greg-rychlewski greg-rychlewski deleted the mysql_subquery_parens branch October 18, 2024 13:59
dkuku pushed a commit to dkuku/ecto_sql that referenced this pull request Nov 4, 2024
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.

subquery inside coalesce produces invalid MySQL query syntax
2 participants