403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.70.208.81
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/mysql-test/suite/group_replication/t/gr_no_user_start_failure.test
################################################################################
# This test proves that the server cannot start when the mysql.session
# is not present.
#
# 0) Start with GR stopped in both servers
# 1) Remove the mysql.session
# 2) Start group replication and see the command errors out
# 3) Restart the server and check the it errors out
# 4) Restore the user
#
################################################################################

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

--echo #
--echo # Delete the user and check the start fails
--echo #

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

#save user timestamps for later restore
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";

--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"

--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

--let $assert_text= Member 1 is OFFLINE
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_members WHERE member_state="OFFLINE"] = 1
--source include/assert.inc

--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_only_after = CURRENT_TEST: group_replication.gr_no_user_start_failure
--let $assert_count = 1
--let $assert_select = There was an error when trying to access the server with user: mysql.session. Make
--let $assert_text = Found the expected error about the missing user in server log
--source include/assert_grep.inc

--echo #
--echo # Restart the server
--echo # Check the plugin is not running
--echo #

--let $allow_rpl_inited=1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $_group_replication_group_whitelist= `SELECT @@GLOBAL.group_replication_ip_whitelist`
--let $restart_parameters=restart:--group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_start_on_boot=1 --group_replication_group_name=$group_replication_group_name --group_replication_ip_whitelist=$_group_replication_group_whitelist
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_group_whitelist GROUP_REPLICATION_GROUP_WHITELIST
--source include/restart_mysqld.inc

--let $rpl_server_number= 1
--source include/rpl_reconnect.inc

--let $assert_text= Member 1 is OFFLINE
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_members WHERE member_state="OFFLINE"] = 1
--source include/assert.inc

--echo #
--echo # Restore the user
--echo #

--disable_query_log
--eval INSERT IGNORE INTO mysql.user VALUES ('localhost','mysql.session','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE','N',"$date_to_restore",NULL,'Y');

--eval INSERT IGNORE INTO mysql.tables_priv VALUES ('localhost', 'mysql', 'mysql.session', 'user', 'root\@localhost', "$date_to_restore_priv", 'Select', '');

INSERT IGNORE INTO mysql.db VALUES ('localhost', 'performance_schema', 'mysql.session','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N');
--enable_query_log

FLUSH PRIVILEGES;

--echo #
--echo # Suppress errors
--echo #

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

--source ../inc/group_replication_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit