You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
drop table if exists t1, t2;
create table t1 (a int, b int);
create table t2 (m int, n int);
insert into t1 values (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
insert into t2 values (1,11), (2,22), (3,32), (4,44), (4,44);
set @@sql_mode='TRADITIONAL';
select count(*) c, a,
( select group_concat(count(a)) from t2 where m = a )
from t1 group by a;
2. What did you expect to see?
mysql> select count(*) c, a,
-> ( select group_concat(count(a)) from t2 where m = a )
-> from t1 group by a;
+---+------+-------------------------------------------------------+
| c | a | ( select group_concat(count(a)) from t2 where m = a ) |
+---+------+-------------------------------------------------------+
| 2 | 2 | 2 |
| 3 | 3 | 3 |
| 1 | 4 | 1,1 |
+---+------+-------------------------------------------------------+
3 rows in set (0.00 sec)
3. What did you see instead?
mysql> select count(*) c, a,
-> ( select group_concat(count(a)) from t2 where m = a )
-> from t1 group by a;
ERROR 1111 (HY000): Invalid use of group function
4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Bug Hunter issue tidb-challenge-program/bug-hunting-issue#78
Bug Report
1. What did you do?
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)Reproducible on master branch:
The text was updated successfully, but these errors were encountered: