403Webshell
Server IP : 172.67.216.182  /  Your IP : 162.158.170.17
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/src/mysql-test/suite/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/rpl/t/rpl_pump.test
# ==== Purpose ====
#
# Create a backup from a master , which at later point can be restored
# successfully on slave.
#
# 1. Perform some DDL/DML operations on a master
# 2. Create a backup from the member using mysqlpump
# 3. Verify if that backup can be later restored successfully on a 2nd server
# 4. See if that @@GLOBAL.GTID_EXECUTED is same on both servers.
# 5. Set up replication.Perform some DDL/DML operations on the master.
# 6. Cleanup
#
# ==== Related Bugs and Worklogs ====
#
# Bug #23748432 MYSQLPUMP FULL LOGICAL BACKUPS UNUSABLE WITH GTID REPLICATION
#
--let $rpl_skip_start_slave= 1
--source include/have_gtid.inc
# test is agnostic to binlog_format
--source include/have_binlog_format_row.inc
--source include/master-slave.inc

# Create a table and insert data into it.
CREATE DATABASE db;
USE db;
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (0);
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=2 WHERE c1=0;
SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
INSERT INTO t1 VALUES (3);
SET GTID_NEXT= 'AUTOMATIC';

--let $master_executed = `SELECT @@GLOBAL.GTID_EXECUTED`

# Create a backup using mysqlpump
--let $server1_backup_file= backup_server1.sql
# Use mysqlpump client to get a dump of server1
--exec $MYSQL_PUMP --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --all-databases --exclude-databases=mysql,mtr > $server_1_datadir/$server1_backup_file

# Restore the backup onto a 2nd server
--echo
--source include/rpl_connection_slave.inc
--exec $MYSQL --user=root --host=127.0.0.1 --port=$SLAVE_MYPORT <  $server_1_datadir/$server1_backup_file

# See if the data has been properly restored on server2
--let $assert_cond = "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_executed"
--let $assert_text = 'gtid_executed should be the same on master and slave'
--source include/assert.inc

--echo
--let $diff_tables= master:db.t1, slave:db.t1
--source include/diff_tables.inc

# Start replication on slave
--echo
--source include/start_slave.inc

# Drop table
--echo
--source include/rpl_connection_master.inc

DROP DATABASE db;

--remove_file $server_1_datadir/$server1_backup_file
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit