From 10.4.13, the mariadb.sys user was created to replace root definers.
In commit 0253ea7, definer of Add/DropGeometryColumn procedures was changed to mariadb.sys, in scripts/maria_add_gis_sp.sql.in.
However, maria_add_gis_sp.sql only applies to new databases created by
installation script. Databases upgraded from old versions will miss this
change. In addition, according to commit 0d6d801(
MDEV-23102), in some scenarios
when root user is replaced it will skip creating mariadb.sys user.
This commit is to update the definer from root to mariadb.sys during
upgrade. It only makes the change if the original definers are root.
Doesn't choose to execute maria_add_gis_sp.sql in upgrade script to
recreate the procedures is because of considering the scenarios of
MDEV-23102 that root user is replaced and mariadb.sys is not created.