Open LostKobrakai opened 3 months ago
I think I kind of understand what you are asking.
Do you have a stub schema, some example rows, and the expected results update results?
In the mean time, I'll see if I can come up with a simpler reproduction of this problem without the json stuff. (although having that in the regression test wouldn't be a bad thing either)
Repo.insert_all("table", [%{number: 0}])
a = from x in fragment("json_each(?)", "[]"), select: %{value: x.value}
u =
from x in "table",
left_join: a in subquery(a), on: true,
update: [set: [number: coalesce(a.value, 1)]]
{1, _} = Repo.update_all(u, [])
This should be a quote simple example. Just needs a table with a number column. You could replace the subquery with a table having a value column (int), but being empty. Currently the update would result in no row updated, where it should.
Elixir version
1.17.2
Database and Version
sqlite 3 (as brought by adapter)
Ecto Versions
3.12.1
Database Adapter and Versions (postgrex, myxql, etc)
exqlite 0.23, ecto_sqlite3 0.17.0
Current behavior
The below query doing left joins is turned into multiple
FROM
clauses, which according to the sqlite docs stating they modeled it after postgres and postgres documenting it to be a cross join, would be a different kind of join.Expected behavior
The join semantics are retained.
Follow up to https://github.com/elixir-ecto/ecto/issues/4502