Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple joins with USING and the same column id clause compilation error #4767

Closed
sebek64 opened this issue Oct 30, 2023 · 1 comment · Fixed by AlecKazakova/sql-psi#573
Closed
Labels

Comments

@sebek64
Copy link

sebek64 commented Oct 30, 2023

SQLDelight Version

2.0.0

Operating System

Linux

Gradle Version

8.4

Kotlin Version

1.9.10

Dialect

sqlite-3-38

AGP Version

No response

Describe the Bug

This code

CREATE TABLE A(
    id INTEGER PRIMARY KEY NOT NULL
);

CREATE TABLE B(
    id INTEGER PRIMARY KEY NOT NULL
);

CREATE TABLE C(
    id INTEGER PRIMARY KEY NOT NULL
);

selectWithJoin:
SELECT *
FROM A
JOIN B USING (id)
JOIN C USING (id);  

causes

Multiple columns found with name id
6    SELECT *
7    FROM A
8    JOIN B USING (id)
9    JOIN C USING (id)
                   ^^

However, the same query run directly on sqlite without issues.

Stacktrace

No response

Gradle Build Script

No response

@sebek64 sebek64 added the bug label Oct 30, 2023
@griffio
Copy link
Contributor

griffio commented Nov 1, 2023

Likely fix will have to be done in sql-psi
✖️ Previous related issues for multiple columns found with name...
AlecKazakova/sql-psi#560
AlecKazakova/sql-psi#145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants