config root man

Current Path : /compat/linux/proc/self/root/usr/opt/mysql57/mysql-test/suite/group_replication/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/opt/mysql57/mysql-test/suite/group_replication/t/gr_user.test

################################################################################
# This test checks the server default user for the SQL session server is not
# affected by GR, and GR fails when it is not there.
#
# Test:
# 0. The test requires one server.
#  - Install plugin at startup.
# 1. On server assert check the GR user 'mysql.session' exists after install.
# 2. Bootstrap start a group. Assert check the GR user 'mysql.session' exists.
# 3. Drop the user. Bootstrap start GR and check the start fails
# 4. Uninstall the plugin and verify that user is still there
# 5. Cleanup
################################################################################

--let $rpl_skip_group_replication_start= 1
--source ../inc/have_group_replication_plugin.inc
--source include/force_restart.inc
--source ../inc/group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

SET SESSION sql_log_bin= 0;
call mtr.add_suppression(".*The group replication user is not present in the server *.*");
SET SESSION sql_log_bin= 1;

--echo #
--echo # Assert the user exist from the start
--echo #

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

--let $assert_text= The group replication user should exist in this member
--let $assert_cond= [SELECT COUNT(*) FROM mysql.user WHERE user="mysql.session"] = 1;
--source include/assert.inc

--echo #
--echo # Start group replication and check all is OK
--echo #

--source ../inc/start_and_bootstrap_group_replication.inc

--let $assert_text= The group replication user should exist in this member
--let $assert_cond= [SELECT COUNT(*) FROM mysql.user WHERE user="mysql.session"] = 1;
--source include/assert.inc

--echo #
--echo # Delete the user and watch GR  fail at start
--echo #

--source include/stop_group_replication.inc

let $date_to_restore=`SELECT password_last_changed from mysql.user where user='mysql.session'`;
let $date_to_restore_priv=`SELECT timestamp from mysql.tables_priv where user='mysql.session'`;
DROP USER "mysql.session"@"localhost";

--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

--echo #
--echo # Recreate the user with an upgrade and see that GR works
--echo #

-- source include/mysql_upgrade_preparation.inc
--echo Run mysql_upgrade
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
--source include/mysql_upgrade_cleanup.inc

--source ../inc/start_and_bootstrap_group_replication.inc

--echo #
--echo # Uninstall plugin and verify that user is still there
--echo #

UNINSTALL PLUGIN group_replication;

--let $assert_text= The group replication user should exist after install
--let $assert_cond= [SELECT COUNT(*) FROM mysql.user WHERE user="mysql.session"] = 1;
--source include/assert.inc

--echo #
--echo # Cleaning
--echo #

--replace_result $GROUP_REPLICATION GROUP_REPLICATION
--eval INSTALL PLUGIN group_replication SONAME '$GROUP_REPLICATION'

SET SESSION sql_log_bin= 0;
call mtr.add_suppression("There was an error when trying to access the server with user: mysql.session. Make*");
call mtr.add_suppression("Error calling group communication interfaces while trying to leave the group");
SET SESSION sql_log_bin= 1;

--disable_query_log ONCE
--eval UPDATE mysql.tables_priv SET timestamp ='$date_to_restore_priv' WHERE USER= 'mysql.session'
--disable_query_log ONCE
--eval UPDATE mysql.user SET password_last_changed= '$date_to_restore' WHERE USER= 'mysql.session'

--source ../inc/group_replication_end.inc

Man Man