mariadb: port latest changes from mysql formula

Closes #20734.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>