Skip to content

Column expansion for quoted non-keyword identifier table does not work well #2575

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

Closed
orisano opened this issue Aug 4, 2023 · 3 comments · Fixed by #2576
Closed

Column expansion for quoted non-keyword identifier table does not work well #2575

orisano opened this issue Aug 4, 2023 · 3 comments · Fixed by #2576
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@orisano
Copy link
Contributor

orisano commented Aug 4, 2023

Version

1.20.0

What happened?

Column expansion for quoted non-keyword identifier table does not work well.

input:

SELECT "t".* FROM foo "t";

output:

SELECT t.c.* FROM t "t";

expected:

SELECT t.c FROM t "t";

or

SELECT "t".c FROM t "t";

Relevant log output

No response

Database schema

CREATE TABLE t (
  c BIGSERIAL PRIMARY KEY
);

SQL queries

-- name: Get :one
SELECT "t".* FROM t "t";

Configuration

{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "postgresql",
      "schema": "query.sql",
      "queries": "query.sql"
    }
  ]
}

Playground URL

https://play.sqlc.dev/p/5532492abf710a8a93ef6fcd72236d0166347c85315ef11da8fcd3a12d67c7f9

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

@orisano orisano added bug Something isn't working triage New issues that hasn't been reviewed labels Aug 4, 2023
orisano added a commit to orisano/sqlc that referenced this issue Aug 4, 2023
@orisano
Copy link
Contributor Author

orisano commented Aug 4, 2023

Same as #2195, #2005, #1444

@orisano
Copy link
Contributor Author

orisano commented Aug 4, 2023

@renjunok It is probably a different issue.
please file an issue yourself.

@renjunok
Copy link

renjunok commented Aug 4, 2023

@orisano Sorry, I have deleted it.

kyleconroy pushed a commit that referenced this issue Aug 28, 2023
…dentifiers (#2576)

* fix(compiler): Fix column expansion to work with quoted non-keyword identifiers

close #2575

* test: add endtoend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants