the query optimizer did not handle queries of the format UCASE(varchar_col)=.... An optimizer_switch option, sargable_casefold=ON, was added in MariaDB 11.3.0 to handle this case. (MDEV-31496) URL: https://mariadb.com/kb/en/upper/https://mariadb.com/kb/en/upper/