403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.69.176.47
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_modify_gtid_executed_explicitly.test
# ==== Purpose ====
#
#  Verify that we do not allow users to modify the mysql.gtid_executed
#  table explicitly by a XA transaction.
#
# ==== Implementation ====
#
#  - Start a XA transaction and modify the mysql.gtid_executed
#    table explicitly.
#  - Check that the ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE error is caused.
#  - Check that users can not modify mysql.gtid_executed table explicitly.
#
# ==== References ====
#
# Bug#21452916  SILENT FAILURE TO START IF MYSQL.GTIDS_EXECUTED GETS HA_ERR_LOCK_WAIT_TIMEOUT
#

--source include/have_binlog_format_row.inc
--source include/have_log_bin.inc
--source include/have_gtid.inc

--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`

CREATE TABLE t1 (a INT);

--echo #
--echo # Verify that inserting gtid into mysql.gtid_executed table
--echo # explicitly by a XA transaction causes an error.
--echo #
XA START '1';
INSERT INTO t1 VALUES(1);
--error ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE
INSERT INTO mysql.gtid_executed VALUES("aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916", 1, 1);
XA END '1';
XA PREPARE '1';
XA COMMIT '1';

FLUSH LOGS;
--echo #
--echo # Verify that users can not insert gtid into mysql.gtid_executed
--echo # table explicitly by a XA transaction.
--echo #
--let $assert_text= Table mysql.gtid_executed must not contain row with source_uuid=aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916
--let $assert_cond= "[SELECT * FROM mysql.gtid_executed WHERE source_uuid="aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916"]" = ""
--source include/assert.inc


--echo #
--echo # Verify that updating mysql.gtid_executed table
--echo # explicitly by a XA transaction causes an error.
--echo #
XA START '1';
INSERT INTO t1 VALUES(2);
--error ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE
UPDATE mysql.gtid_executed SET source_uuid = "aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916" WHERE source_uuid = '$master_uuid';
XA END '1';
XA PREPARE '1';
XA COMMIT '1';

--echo #
--echo # Verify that users can not update mysql.gtid_executed
--echo # table explicitly by a XA transaction.
--echo #
--let $assert_text= Table mysql.gtid_executed must not contain row with source_uuid=aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916
--let $assert_cond= "[SELECT * FROM mysql.gtid_executed WHERE source_uuid="aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916"]" = ""
--source include/assert.inc

--echo #
--echo # Verify that deleting from mysql.gtid_executed table
--echo # explicitly by a XA transaction causes an error.
--echo #
XA START '1';
INSERT INTO t1 VALUES(3);
--error ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE
DELETE FROM mysql.gtid_executed WHERE source_uuid = '$master_uuid';
XA END '1';
XA PREPARE '1';
XA COMMIT '1';

--echo #
--echo # Verify that users can not delete from mysql.gtid_executed
--echo # table explicitly by a XA transaction.
--echo #
--let $assert_text= Table mysql.gtid_executed must contain GTID(s) with source_uuid = master_uuid
--let $assert_cond= "[SELECT COUNT(*) FROM mysql.gtid_executed WHERE source_uuid = "$master_uuid"]" > 0
--source include/assert.inc

DROP TABLE t1;

Youez - 2016 - github.com/yon3zu
LinuXploit