403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.69.176.110
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/binlog/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/binlog/t/binlog_gtid_mysqldump.test
# ==== Purpose ====
#
# Verify that GTID_EXECUTED and GTID_PURGED are correctly restored by
# mysqldump, even after a restart.
#
# ==== Implementation ====
#
# Execute some transactions in different binary logs, purge some of them.
# Take a dump. Drop the table and RESET MASTER. Verify that
# GTID_EXECUTED and GTID_PURGED after the dump equal GTID_EXECUTED before
# the dump. Restart server. Repeat the check.
#
# ==== Bugs ====
#
# BUG#24590891: RESTARTING A SLAVE AFTER SEEDING IT WITH A MYSQLDUMP LOSES IT'S POSITION

# Agnostic to binlog_format.
--source include/have_binlog_format_statement.inc
--source include/have_gtid.inc

--echo ==== Initialize ====

CREATE TABLE t1 (a INT);
FLUSH LOGS;
--let $current_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--replace_result $current_binlog_file <CURRENT_BINLOG>
eval PURGE BINARY LOGS TO '$current_binlog_file';
INSERT INTO t1 VALUES (1);
FLUSH LOGS;
INSERT INTO t1 VALUES (2);
--let $gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`

--echo ==== Dump and restore ====

--echo # dump
# Use --ignore-table=proc to workaround BUG#25295631.
--exec $MYSQL_DUMP --all-databases --triggers --routines --events --ignore-table=mysql.proc >> $MYSQL_TMP_DIR/mysqldump.sql

DROP TABLE t1;
RESET MASTER;

--echo # restore
--exec $MYSQL < $MYSQL_TMP_DIR/mysqldump.sql

--echo ==== Verify ====

--let $assert_text= GTID_EXECUTED should equal master GTID_EXECUTED after dump restored
--let $assert_cond= @@GLOBAL.GTID_EXECUTED = "$gtid_executed"
--source include/assert.inc
--let $assert_text= GTID_PURGED should equal master GTID_EXECUTED after dump restored
--let $assert_cond= @@GLOBAL.GTID_PURGED = "$gtid_executed"
--source include/assert.inc

--source include/restart_mysqld.inc

--let $assert_text= GTID_EXECUTED should equal master GTID_EXECUTED after server restarted
--let $assert_cond= @@GLOBAL.GTID_EXECUTED = "$gtid_executed"
--source include/assert.inc
--let $assert_text= GTID_PURGED should equal master GTID_EXECUTED after server restarted
--let $assert_cond= @@GLOBAL.GTID_PURGED = "$gtid_executed"
--source include/assert.inc

--echo ==== Clean up ====

DROP TABLE t1;

Youez - 2016 - github.com/yon3zu
LinuXploit