You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
UPDATE"qwer_projects"AS q0
SET"snapshots"= json_insert(CASE WHEN json_array_length(q0."snapshots") >=10 THEN json_remove(q0."snapshots",'$[0]') ELSE q0."snapshots" END,'$[#]',json_object('placeables',s1."json",'links',s2."json"))
FROM
(
SELECT json_group_array(json_object([...fields])) AS"json"FROM"qwer_placeables"AS sq0
WHERE (sq0."project_id"= ?)
GROUP BY TRUE
) AS s1,
(
SELECT json_group_array(json_object([...fields])) AS"json"FROM"qwer_links"AS sq0
WHERE (sq0."project_id"= ?)
GROUP BY TRUE
) AS s2
WHERE (q0."id"= ?)
Expected behavior
The join semantics are retained.
This could be a bug in the sqlite adapter as well, but it's hard to judge from the outside.
The text was updated successfully, but these errors were encountered:
Can you please file this in ecto_sqlite? For Postgres/MySQL/etc we literally generate a LEFT JOIN, so I don't believe the issue is ecto_sql itself but further transformations:
test "update all with left join" do
query =
from(m in Schema,
join: x in assoc(m, :comments),
left_join: p in assoc(m, :permalink),
update: [set: [w: m.list2]]
)
|> plan(:update_all)
assert update_all(query) ==
~s{UPDATE "schema" AS s0 SET "w" = s0."list2" FROM "schema2" AS s1 LEFT OUTER JOIN "schema3" AS s2 ON s2."id" = s0."y" WHERE (s1."z" = s0."x")}
end
Unfortunately we cannot transfer issues across orgs.
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.
This could be a bug in the sqlite adapter as well, but it's hard to judge from the outside.
The text was updated successfully, but these errors were encountered: