Skip to content

Conversation

@jackwener
Copy link
Member

@jackwener jackwener commented Dec 8, 2022

Which issue does this PR close?

Closes #4554 .

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the sql SQL Planner label Dec 8, 2022
//
// For example:
//
// SELECT c1 AS m FROM t HAVING m > 10;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any bug for the implementation?

Copy link
Member Author

@jackwener jackwener Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently this sql can't work.

is there any bug for the implementation?

Discussion about this, you can see #4556

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Postgres agrees:

postgres=# create table t (c1 int);
CREATE TABLE
postgres=# insert into t  values (1), (2);
INSERT 0 2
postgres=# SELECT c1 AS m FROM t HAVING m > 10;
ERROR:  column "m" does not exist
LINE 1: SELECT c1 AS m FROM t HAVING m > 10;
                                     ^
postgres=# 

//
// For example:
//
// SELECT c1 AS m FROM t HAVING m > 10;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Postgres agrees:

postgres=# create table t (c1 int);
CREATE TABLE
postgres=# insert into t  values (1), (2);
INSERT 0 2
postgres=# SELECT c1 AS m FROM t HAVING m > 10;
ERROR:  column "m" does not exist
LINE 1: SELECT c1 AS m FROM t HAVING m > 10;
                                     ^
postgres=# 

@alamb alamb merged commit 747e5a7 into apache:master Dec 9, 2022
@jackwener jackwener deleted the fix_comment branch December 9, 2022 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrong comment about having

4 participants