Skip to content

Commit

Permalink
Update From false positive for multiple columns found with name (#4777)
Browse files Browse the repository at this point in the history
- Sqlite 3.33
  • Loading branch information
eygraber authored and hfhbd committed Apr 2, 2024
1 parent d897967 commit 0750807
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ internal abstract class UpdateStmtLimitedMixin(
FromQuery {
override fun queryAvailable(child: PsiElement): Collection<QueryElement.QueryResult> {
if (child != joinClause && joinClause != null) {
return super.queryAvailable(child) + joinClause!!.queryExposed()
return super.queryAvailable(child) +
joinClause!!.queryExposed().map { it.copy(adjacent = true) }
}

return super.queryAvailable(child)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ CREATE TABLE test2(
id2 TEXT
);

CREATE TABLE test3(
id INTEGER NOT NULL,
data TEXT NOT NULL
);

UPDATE test
SET id = id2
FROM (
Expand Down Expand Up @@ -40,4 +45,7 @@ FROM (
ON otherTest.id = test2.id2
);


UPDATE test3
SET data = subquery.data
FROM (SELECT id, data FROM test3) subquery
WHERE subquery.id = test3.id;

0 comments on commit 0750807

Please sign in to comment.