MDEV-6667: Merged fix from maria-10.0-galera.