Skip to content

GROUP BY clause references not validated #1284

@timstudd

Description

@timstudd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions