Sqlite: Using column from table being updated in left join predicate generates invalid SQL
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
Test: Update_with_cross_join_left_join_set_constant
```C#
AssertExecuteUpdateSql(
@"UPDATE ""Customers"" AS ""c""
SET ""ContactName"" = 'Updated'
FROM (
SELECT ""c0"".""CustomerID"", ""c0"".""Address"", ""c0"".""City"", ""c0"".""CompanyName"", ""c0"".""ContactName"", ""c0"".""ContactTitle"", ""c0"".""Country"", ""c0"".""Fax"", ""c0"".""Phone"", ""c0"".""PostalCode"", ""c0"".""Region""
FROM ""Customers"" AS ""c0""
WHERE ""c0"".""City"" IS NOT NULL AND (""c0"".""City"" LIKE 'S%')
) AS ""t""
LEFT JOIN (
SELECT ""o"".""OrderID"", ""o"".""CustomerID"", ""o"".""EmployeeID"", ""o"".""OrderDate""
FROM ""Orders"" AS ""o""
WHERE ""o"".""OrderID"" < 10300
) AS ""t0"" ON ""c"".""CustomerID"" = ""t0"".""CustomerID""
WHERE ""c"".""CustomerID"" LIKE 'F%'");
```
Now throws invalid SQL error earlier used to work. Change in PR #28884
Filed https://www.sqlite.org/forum/forumpost/09862e12c7
Contributor guide
Assessment
This issue has not been assessed yet.