This is a regression bug in MySQL 8.0.20, which changes behavior comparing to earlier 8.0 versions or 5.7.
This report aims to help to avoid this regression in upcoming Percona Server release of the same version.
I belive it is the same one as https://bugs.mysql.com/bug.php?id=99398
There is a test case in upstream version, but below is how to reproduce with a little bit different case:
– create two sandboxes to compare both
– copy the .sh script to sandbox dir and .sql files to /tmp/
– install mysql_random_data_load tool
– run the test, the result should be different for GROUP BY query variant on both