mariadb/mysql-test/main/mysql_upgrade-6984.test
Oleksandr Byelkin 0253ea7f22 MDEV-19650: Privilege bug on MariaDB 10.4
Also fixes:
MDEV-21487: Implement option for mysql_upgrade that allows root@localhost to be replaced
MDEV-21486: Implement option for mysql_install_db that allows root@localhost to be replaced

Add user mariadb.sys to be definer of user view
(and has right on underlying table global_priv for
required operation over global_priv
(SELECT,UPDATE,DELETE))

Also changed definer of gis functions in case of creation,
but they work with any definer so upgrade script do not try
to push this change.
2020-05-07 10:54:56 +02:00

23 lines
787 B
Text

#
# MDEV-6984 Can't migrate from MySQL 5.6.21 to MariaDB 10
#
--source include/not_embedded.inc
#
# When 'root' account is password protected and MYSQL_UPGRADE doesn't
# know the password (meaning, MYSQL_UPGRADE is run automatically
# on upgrade), MYSQLD has to be started with --skip-grant-tables.
#
# In this setup MYSQL_UPGRADE cannot continue after issuing FLUSH PRIVILEGES
#
update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')) where user='root';
--exec $MYSQL_UPGRADE
connect(con1,localhost,root,foo,,,);
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$.authentication_string')) where user='root';
flush privileges;
# Load event table
set global event_scheduler=OFF;