MySQL 8.0: GROUPING function
Starting with MySQL 8.0.1, the server supports the SQL GROUPING function. The GROUPING function is used to distinguish between a NULL representing the set of all values in a super-aggregate row (produced by a ROLLUP operation) from a NULL in a regular row.…
Source: MySQL 8.0: GROUPING function