mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
3622644836
Renames the upgrade state file, and ensures the old file is properly removed when `mariadb-upgrade` tool is executed. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
127 lines
3.5 KiB
Text
127 lines
3.5 KiB
Text
-- source include/mysql_upgrade_preparation.inc
|
|
-- source include/have_working_dns.inc
|
|
-- source include/have_innodb.inc
|
|
-- source include/have_partition.inc
|
|
let $MYSQLD_DATADIR= `select @@datadir`;
|
|
|
|
|
|
--echo #
|
|
--echo # MDEV-22057 REPLICATION MASTER ADMIN is missing in root account after upgrade
|
|
--echo #
|
|
|
|
--source include/switch_to_mysql_user.inc
|
|
DROP VIEW mysql.user_bak;
|
|
FLUSH PRIVILEGES;
|
|
|
|
CREATE USER user_all@localhost;
|
|
GRANT ALL PRIVILEGES ON *.* TO user_all@localhost WITH GRANT OPTION;
|
|
SHOW GRANTS FOR user_all@localhost;
|
|
|
|
CREATE USER user_super@localhost;
|
|
GRANT SUPER ON *.* TO user_super@localhost;
|
|
SHOW GRANTS FOR user_super@localhost;
|
|
|
|
CREATE USER user_super_replslave@localhost;
|
|
GRANT SUPER, REPLICATION SLAVE ON *.* TO user_super_replslave@localhost;
|
|
SHOW GRANTS FOR user_super_replslave@localhost;
|
|
|
|
--echo #
|
|
--echo # MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
|
|
--echo #
|
|
|
|
--echo #
|
|
--echo # Users with privilege SUPER prior to 10.5 should successfully execute
|
|
--echo # SHOW SLAVE STATUS command
|
|
--echo #
|
|
CREATE USER user_replsuper@localhost;
|
|
GRANT SUPER ON *.* TO user_replsuper@localhost;
|
|
SHOW GRANTS FOR user_replsuper@localhost;
|
|
|
|
--echo #
|
|
--echo # Users with privilege REPLICATION CLIENT prior to 10.5 should successfully execute
|
|
--echo # SHOW SLAVE STATUS command
|
|
--echo #
|
|
CREATE USER user_replclient@localhost;
|
|
GRANT REPLICATION CLIENT ON *.* TO user_replclient@localhost;
|
|
SHOW GRANTS FOR user_replclient@localhost;
|
|
|
|
--echo #
|
|
--echo # Users with privilege REPLICATION SLAVE prior to 10.5 should successfully execute
|
|
--echo # SHOW RELAYLOG EVENTS command
|
|
--echo #
|
|
CREATE USER user_replslave@localhost;
|
|
GRANT REPLICATION SLAVE ON *.* TO user_replslave@localhost;
|
|
SHOW GRANTS FOR user_replslave@localhost;
|
|
|
|
--echo # mysql_upgrade --force --silent 2>&1
|
|
--exec $MYSQL_UPGRADE --force --silent 2>&1
|
|
--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
|
|
FLUSH PRIVILEGES;
|
|
|
|
--echo #
|
|
--echo # Should get ALL PRIVILEGES WITH GRANT OPTION
|
|
--echo #
|
|
SHOW GRANTS FOR user_all@localhost;
|
|
|
|
--echo #
|
|
--echo # Should automatically get all new 10.5.2 priveleges that were splitted from SUPER
|
|
--echo #
|
|
SHOW GRANTS FOR user_super@localhost;
|
|
|
|
--echo #
|
|
--echo # Should automatically get all new 10.5.2 priveleges that were splitted from SUPER, plus REPLICATION MASTER ADMIN
|
|
--echo #
|
|
SHOW GRANTS FOR user_super_replslave@localhost;
|
|
|
|
--echo #
|
|
--echo # MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
|
|
--echo #
|
|
|
|
--echo #
|
|
--echo # Should automatically get BINLOG MONITOR and REPLICA MONITOR
|
|
--echo #
|
|
SHOW GRANTS FOR user_replclient@localhost;
|
|
|
|
--echo #
|
|
--echo # Should automatically get REPLICA MONITOR
|
|
--echo #
|
|
SHOW GRANTS FOR user_replslave@localhost;
|
|
|
|
--connect (con1,localhost,user_super_replslave,,"*NO-ONE*")
|
|
--connection con1
|
|
--disable_result_log
|
|
SHOW SLAVE STATUS;
|
|
--enable_result_log
|
|
--disconnect con1
|
|
|
|
--connect (con1,localhost,user_replclient,,"*NO-ONE*")
|
|
--connection con1
|
|
--disable_result_log
|
|
SHOW SLAVE STATUS;
|
|
--enable_result_log
|
|
--disconnect con1
|
|
|
|
--connect (con1,localhost,user_replslave,,"*NO-ONE*")
|
|
--connection con1
|
|
--disable_ps_protocol
|
|
--disable_result_log
|
|
SHOW RELAYLOG EVENTS;
|
|
--enable_result_log
|
|
--enable_ps_protocol
|
|
--disconnect con1
|
|
|
|
--connection default
|
|
SELECT
|
|
json_value(Priv, '$.version_id'),
|
|
json_value(Priv, '$.access'),
|
|
user
|
|
FROM
|
|
mysql.global_priv
|
|
WHERE
|
|
host='localhost'
|
|
AND
|
|
user LIKE 'user_%';
|
|
|
|
DROP TABLE mysql.global_priv;
|
|
RENAME TABLE mysql.global_priv_bak TO mysql.global_priv;
|
|
FLUSH PRIVILEGES;
|