`GROUP BY ROLLUP`
- 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
Assessment
This issue has not been assessed yet.