403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.71.82.109
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_begin_caused_trx.test
# ==== Purpose ====
#
# When @@SESSION.GTID_NEXT == 'UUID:NUMBER', verify that the command
# 'BEGIN' causes an error
# 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET' inside
# an empty/a non-empty transaction, since it causes an implicit
# commit. We do not save the gtid specified by GTID_NEXT into
# GLOBAL@gtid_executed in the case.
#
# ==== Implementation ====
#
# 1) Set @@SESSION.GTID_NEXT == 'UUID:NUMBER'
# 2) Execute a 'BEGIN' command to start a transaction.
# 3) Execute another 'BEGIN' command to check if it causes an error
#    'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET'
#    inside an empty transaction, and we do not save the gtid
#    specified by GTID_NEXT into GLOBAL@gtid_executed.
# 4) Execute an 'INSERT' statement.
# 5) Execute the third 'BEGIN' command to check if it causes an error
#    'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET'
#    inside a non-empty transaction, and we do not save the gtid
#    specified by GTID_NEXT into GLOBAL@gtid_executed.
# 6) Check that we save the gtid specified by GTID_NEXT into
#    GLOBAL@gtid_executed when committing the transaction.
#
# ==== References ====
#
# Bug#22130929  GTID_NEXT AND BEGIN BEHAVIOR IS DIFFERENT B/W BINLOG AND BINLOG-LESS SERVER
# Caller: suite/binlog/t/binlog_gtid_next_begin_caused_trx.test
# Caller: t/no_binlog_gtid_next_begin_caused_trx.test
#

SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
CREATE TABLE t1 (c1 INT);
SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2';
BEGIN;

--echo #
--echo # Check that the command 'BEGIN' causes an error
--echo # 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET' inside
--echo # an empty transaction, since it causes an implicit commit. And we
--echo # do not save the gtid specified by GTID_NEXT into
--echo # GLOBAL@gtid_executed in the case.
--echo #
--error ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET
BEGIN;
--let $assert_text= Dose not commit gtid aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1"
--source include/assert.inc

INSERT INTO t1 VALUES (1);
--echo #
--echo # Check that the command 'BEGIN' causes an error
--echo # 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET' inside
--echo # a non-empty transaction, since it causes an implicit commit. And
--echo # we do not save the gtid specified by GTID_NEXT into
--echo # GLOBAL@gtid_executed in the case.
--echo #
--error ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET
BEGIN;
--let $assert_text= Dose not commit gtid aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1"
--source include/assert.inc

--echo #
--echo # Check that we save the gtid specified by GTID_NEXT into
--echo # GLOBAL@gtid_executed when committing the transaction.
--echo #
COMMIT;
--let $assert_text= Committed gtid aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-2"
--source include/assert.inc

SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3';
DROP TABLE t1;


Youez - 2016 - github.com/yon3zu
LinuXploit