The problem is exposed through the integration tests of DocumentTreeMacroIT when using Mysql LTS UTF-8 with the following command:
xwiki-platform-index-test/xwiki-platform-index-test-docker$ mvn clean install -Dit.test=DocumentTreeMacroIT -Dxwiki.test.ui.database=mysql -Dxwiki.test.ui.databaseTag=lts -Dxwiki.test.ui.database.commands.character-set-server=utf8 -Dxwiki.test.ui.database.commands.collation-server=utf8_bin
It's probably a regression since 17.6.0: there's no failures when executing tests on 17.5.0.