Skip to content

Fix subqueries in interpolated join wheres#4764

Draft
lukaszsamson wants to merge 3 commits into
elixir-ecto:masterfrom
lukaszsamson:ls-where-join-subquery
Draft

Fix subqueries in interpolated join wheres#4764
lukaszsamson wants to merge 3 commits into
elixir-ecto:masterfrom
lukaszsamson:ls-where-join-subquery

Conversation

@lukaszsamson

Copy link
Copy Markdown
Contributor

Fixes #4763

Comment thread lib/ecto/query.ex
defmodule QueryExpr do
@moduledoc false
defstruct [:expr, :file, :line, params: []]
defstruct [:expr, :file, :line, params: [], subqueries: []]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we instead use a BooleanExpr or add subqueries to the JoinExpr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can try that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@josevalim I had fable create an alternative basing on your suggestion #4765

Note the JoinExpr.subqueries alternative would be more problematic as it requires threading context through traversals.

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.

Interpolating a query containing a where subquery into a join crashes the planner

2 participants