Skip to content

GROUP BY clause references not validated #1284

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
timstudd opened this issue Nov 13, 2021 · 0 comments
Closed

GROUP BY clause references not validated #1284

timstudd opened this issue Nov 13, 2021 · 0 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@timstudd
Copy link
Contributor

timstudd commented Nov 13, 2021

Version

1.10.0

What happened?

An error should be returned when a GROUP BY clause references a column that does not exist

Relevant log output

No response

Database schema

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL,
  bio  text
);

SQL queries

-- name: ListAuthors :many
SELECT   *
FROM     authors
GROUP BY invalid_reference;

Configuration

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

Playground URL

https://play.sqlc.dev/p/6e1c775ff5f5b3709903bc77dac8aa51f321a648fd00f4990e1c3eceead271ae

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@timstudd timstudd added bug Something isn't working triage New issues that hasn't been reviewed labels Nov 13, 2021
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

No branches or pull requests

2 participants