403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.70.142.145
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_high_prio_rollback.test
# This test conflict cases between local and remote transactions.
# This test proves the rollback mechanisms are working as intended

--source ../inc/have_group_replication_plugin.inc
--source ../inc/group_replication.inc

--echo #
--echo # Create the test table on server 1
--echo #

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

CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;

--source include/rpl_sync.inc

--echo #
--echo # Test case 1 - error on commit
--echo # Start a transaction on server 1
--echo # Execute a concurrent transaction on server 2.
--echo # Try to commit the transaction on server 1, it should fail.
--echo #

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

BEGIN;
INSERT INTO t1 VALUES (1);

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

INSERT INTO t1 VALUES (1);

--source include/rpl_sync.inc

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

--error ER_TRANSACTION_ROLLBACK_DURING_COMMIT, ER_ERROR_DURING_COMMIT
COMMIT;

--echo #
--echo # Test case 1 - error on commit
--echo # Check all is fine
--echo #

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

INSERT INTO t1 VALUES (2);

--source include/rpl_sync.inc

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

INSERT INTO t1 VALUES (3);

--source include/rpl_sync.inc

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

--let $assert_text= On member1, the table t1 should contain 3 rows
--let $assert_cond= [SELECT COUNT(*) FROM t1] = 3;
--source include/assert.inc

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

--let $assert_text= On member2, the table t1 should contain 3 rows
--let $assert_cond= [SELECT COUNT(*) FROM t1] = 3;
--source include/assert.inc

--echo #
--echo # Test case 2 - error on second insert
--echo # Start a transaction on server 1
--echo # Execute a concurrent transaction on server 2.
--echo # Try to execute another insert on server 1 transaction, it should fail.
--echo #

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

BEGIN;
INSERT INTO t1 VALUES (11);

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

INSERT INTO t1 VALUES (11);

--source include/rpl_sync.inc

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

--error ER_TRANSACTION_ROLLBACK_DURING_COMMIT, ER_LOCK_DEADLOCK
INSERT INTO t1 VALUES (12);

COMMIT;

--echo #
--echo # Test case 2 - error on second insert
--echo # Check all is fine
--echo #

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

--let $assert_text= On member1, the rolled back transaction is not there
--let $assert_cond= [SELECT COUNT(*) FROM t1 WHERE c1=12] = 0;
--source include/assert.inc

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

--let $assert_text= On member2, the rolled back transaction is not there
--let $assert_cond= [SELECT COUNT(*) FROM t1 WHERE c1=12] = 0;
--source include/assert.inc

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

INSERT INTO t1 VALUES (12);

--source include/rpl_sync.inc

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

INSERT INTO t1 VALUES (13);

--source include/rpl_sync.inc

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

--let $assert_text= On member1, the table t1 should contain 6 rows
--let $assert_cond= [SELECT COUNT(*) FROM t1] = 6;
--source include/assert.inc

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

--let $assert_text= On member2, the table t1 should contain 6 rows
--let $assert_cond= [SELECT COUNT(*) FROM t1] = 6;
--source include/assert.inc

--echo #
--echo # Cleanup
--echo #

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

DROP TABLE t1;

--source ../inc/group_replication_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit