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

only_full_group_by is checked wrongly #13652

Closed
XuHuaiyu opened this issue Nov 21, 2019 · 0 comments
Closed

only_full_group_by is checked wrongly #13652

XuHuaiyu opened this issue Nov 21, 2019 · 0 comments
Assignees
Labels
type/bug The issue is confirmed as a bug.

Comments

@XuHuaiyu
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
mysql> create table t(tp_real real);
mysql> select tp_real from t group by (tp_real);
mysql> select tp_real from t group by tp_real;
  1. What did you expect to see?
mysql> create table t(tp_real real);
Query OK, 0 rows affected (0.12 sec)

mysql> select tp_real from t group by (tp_real);
Empty set (0.04 sec)

mysql> select tp_real from t group by tp_real;
Empty set (0.04 sec)
  1. What did you see instead?
mysql> create table t(tp_real real);
Query OK, 0 rows affected (0.12 sec)

mysql> select tp_real from t group by (tp_real);
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t.tp_real' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

mysql> select tp_real from t group by tp_real;
Empty set (0.04 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    mysql> select tidb_Version();
    +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | tidb_Version() |
    +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Release Version: v4.0.0-alpha-822-ge9f19970d
    Git Commit Hash: e9f1997
    Git Branch: master
    UTC Build Time: 2019-11-11 01:44:23
    GoVersion: go version go1.13.1 linux/amd64
    Race Enabled: false
    TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
    Check Table Before Drop: false |
    +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.03 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants