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

Different error message from MySQL when group by a window function with a as #16473

Open
time-and-fate opened this issue Apr 16, 2020 · 0 comments
Assignees
Labels
severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug. type/compatibility

Comments

@time-and-fate
Copy link
Member

Bug Report

1. What did you do?

In a select stmt, group by a window function using its asname.

2. What did you expect to see?

In 8.0.19 MySQL Community:

MySQL [test]> select row_number() over () as x from t group by x;
ERROR 1056 (42000): Can't group on 'x'

3. What did you see instead?

In TiDB:

MySQL [test]> select row_number() over () as x from t group by x;
ERROR 1247 (42S22): Reference 'x' not supported (reference to window function)

4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)

Release Version: v4.0.0-beta-710-gac8785a97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug. type/compatibility
Projects
None yet
Development

No branches or pull requests

4 participants