pingcap / pingcap/tidb

`GROUP BY ROLLUP`

Open
#68,088 2 comments 0 reactions 0 assignees View on GitHub
compatibility-mysql97 severity/minor sig/sql-infra type/bug type/compatibility
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

MySQL 9.7.0:
```
mysql-9.7.0 [test]> select host,count(*) from mysql.user group by host with rollup;
+-----------+----------+
| host | count(*) |
+-----------+----------+
| % | 1 |
| localhost | 5 |
| NULL | 6 |
+-----------+----------+
3 rows in set (0.001 sec)

mysql-9.7.0 [test]> select host,count(*) from mysql.user group by rollup (host);
+-----------+----------+
| host | count(*) |
+-----------+----------+
| % | 1 |
| localhost | 5 |
| NULL | 6 |
+-----------+----------+
3 rows in set (0.001 sec)
```

TiDB v8.5.6:
```
mysql-8.0.11-TiDB-v8.5.6 [test]> select host,count(*) from mysql.user group by host with rollup;
+------+----------+
| host | count(*) |
+------+----------+
| NULL | 2 |
| % | 2 |
+------+----------+
2 rows in set (0.002 sec)

mysql-8.0.11-TiDB-v8.5.6 [test]> select host,count(*) from mysql.user group by rollup (host);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 54 near "(host)"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.