403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.242.45
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/extra/binlog_tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/extra/binlog_tests/gtid_next_xa.test
# ==== Purpose ====
#
# Auxiliary test file included by 'binlog_gtid_next_xa.test'.
#
# This executes an XA PREPARE transaction, followed by an XA COMMIT or
# XA ROLLBACK transaction.  It sets specified values of GTID_NEXT
# before each of the two transactions.  After each transaction it
# verifies that GTID ownership is as expected.
#
# ==== Usage ====
#
# --let $gtid1= [<GTID> | ANONYMOUS | AUTOMATIC]
# --let $gtid2= [<GTID> | ANONYMOUS | AUTOMATIC | none]
# --let $commit= [COMMIT | ROLLBACK]
# --let $error= [0 | N]
# --let $one_phase = [one phase]
# --source extra/rpl_tests/rpl_gtid_next_xa.test
#
# Parameters:
#
#   $commit
#     If this is COMMIT, the second transaction will be an XA COMMIT
#     transaction. If this is ROLLBACK, the second transaction will be
#     an XA ROLLBACK transaction.
#
#   $gtid1
#     The value to use for GTID_NEXT for the first transaction
#     (XA PREPARE).
#
#   $gtid2
#     The value to use for GTID_NEXT for the second transaction
#     (XA COMMIT/ROLLBACK).  If this is 'none', no SET GTID_NEXT
#     statement is used and the previous value is reused.
#
#   $error
#     This is GTID setting related error.
#     Normally, this script expects all statements to succeed.  For
#     those cases, the caller must set $error=0. But if $gtid1 is a
#     GTID and $gtid2 is none, ER_GTID_NEXT_TYPE_UNDEFINED_GROUP is
#     expected for the second transaction.  Then the caller must set
#     $error= ER_GTID_NEXT_TYPE_UNDEFINED_GROUP.
#
#   $one_phase
#     Option to commit XA in one phase


--echo ---- XID $xid, $commit: $gtid1 + $gtid2 ----
--source include/rpl_connection_master.inc

if ($gtid1 != none)
{
  eval SET GTID_NEXT= '$gtid1';
}

eval XA START '$xid';
eval INSERT INTO t1 VALUES($xid);
eval XA END '$xid';
if (!$one_phase)
{
  eval XA PREPARE '$xid';


  --let $assert_text= Thread should not own any GTID.
  --let $assert_cond= @@SESSION.GTID_OWNED = ""
  --source include/assert.inc

  --source include/rpl_connection_master1.inc

  --let $assert_text= No thread should own any GTID.
  --let $assert_cond= @@GLOBAL.GTID_OWNED = ""
  --source include/assert.inc

  --let $assert_text= No thread should hold anonymous ownership.
  --let $assert_cond= [SHOW STATUS LIKE "ONGOING_ANONYMOUS_TRANSACTION_COUNT", Value, 1] = 0
  --source include/assert.inc

  --source include/rpl_connection_master.inc

  --echo error=$error
if ($gtid2 != none)
{
  eval SET GTID_NEXT= '$gtid2';
}

if ($error)
{
  # Generate erratic statement, check that GTID ownership is ok, then
  # set GTID_NEXT to valid value to allow the statement to execute
  # correctly.

  --error $error
  eval XA $commit '$xid';

  --source include/rpl_connection_master1.inc

  --let $assert_text= No thread should own any GTID.
  --let $assert_cond= @@GLOBAL.GTID_OWNED = ""
  --source include/assert.inc

  --let $assert_text= No thread should hold anonymous ownership.
  --let $assert_cond= [SHOW STATUS LIKE "ONGOING_ANONYMOUS_TRANSACTION_COUNT", Value, 1] = 0
  --source include/assert.inc

  --source include/rpl_connection_master.inc

  SET GTID_NEXT = 'AUTOMATIC';
}
}

if ($commit == ROLLBACK)
{
   # Reset $one_phase to empty in this case to satisfy syntax
   --let $one_phase=
}
eval XA $commit '$xid' $one_phase;

--let $assert_text= Thread should not own any GTID.
--let $assert_cond= @@SESSION.GTID_OWNED = ""
--source include/assert.inc

--let $assert_text= No thread should own any GTID.
--let $assert_cond= @@GLOBAL.GTID_OWNED = ""
--source include/assert.inc

--let $assert_text= No thread should hold anonymous ownership.
--let $assert_cond= [SHOW STATUS LIKE "ONGOING_ANONYMOUS_TRANSACTION_COUNT", Value, 1] = 0
--source include/assert.inc

ROLLBACK;
--inc $xid
SET GTID_NEXT = 'AUTOMATIC';

Youez - 2016 - github.com/yon3zu
LinuXploit