Skip to content

Commit

Permalink
Update From false positive for multiple columns found with name
Browse files Browse the repository at this point in the history
  - Sqlite 3.33
  • Loading branch information
eygraber committed Nov 12, 2023
1 parent bdb0bd9 commit 6afc5a0
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 6afc5a0

Please sign in to comment.