our database is completely in UTF8MB4. Commit below force "SET NAMES latin1" after connection to backend servers.
Due to this change, in case of failover/switchover are executed ALTER EVENT queries and MariaDB change charset of these events from utf8mb4 to latin1. After that, our events doesn't work due to Illegal mix of charset/collation errors.
CREATE/ALTER EVENT, unfortunately take charset & collation from client connection.
Possible proper way to handle this would be execute "SET NAMES %charset%; SET connection_collation %collation%".
Variable %charset% can be loaded from @@global.character_set_database or @@global.character_set_server.
Variable %collation% can be loaded from @@global.collation_database or select @@global.collation_server.
Or, this charset and collation would be changeable by some optional variables in maxscale.cnf?
We tried to add "SET NAMES utf8mb4; SET collation_connection = utf8mb_czech_ci;" into our promotion/demotion SQL files, but these commands are executed after ALTER EVENTS, so it's too late to handle that case.