Server IP : 172.67.216.182 / Your IP : 172.68.164.105 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/mysql-test/suite/group_replication/t/ |
Upload File : |
################################################################################ # 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