Server IP : 172.67.216.182 / Your IP : 172.69.176.46 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 : |
################################################################################ # This test verifies the DML errors when replicating in a group # # Test: # 0. The test requires two servers: M1 and M2. # 1. With both members ONLINE. Create two tables. Insert data in each table. # 2. Now verify that DML(INSERT/UPDATE) operations with duplicate data, error # out gracefully. Thus, nothing is inserted/updated in such cases. Verify # the data on both the members M1 and M2. ################################################################################ --source ../inc/have_group_replication_plugin.inc --source ../inc/group_replication.inc --echo # Verify the statements can be binlogged correctly when error happens CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=innodb; CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE=innodb; INSERT INTO t1 VALUES(1); INSERT INTO t2 VALUES(1); --echo --echo # Nothing is inserted. --let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1) --error 1062 INSERT INTO t1 VALUES(1),(2); source include/show_binlog_events.inc; --let $assert_text= No new row inserted in the table --let $assert_cond= [SELECT count(*) FROM t1] = 1 --source include/assert.inc --source include/rpl_sync.inc --let $diff_tables= server1:test.t1, server2:test.t1 --source include/diff_tables.inc --echo --echo # Nothing is inserted. --connection server1 --let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1) --error 1062 INSERT INTO t1 SELECT 1 UNION SELECT 2; --source include/show_binlog_events.inc # The row count will still be 1 --let $assert_text= The row count will still be 1 --let $assert_cond= [SELECT count(*) FROM t1] = 1 --source include/assert.inc --echo # 2 rows are inserted. INSERT INTO t1 SELECT 3 UNION SELECT 2; --source include/rpl_sync.inc # The row count will be 3 --let $assert_text= A row is inserted in the table t1 --let $assert_cond= [SELECT count(*) FROM t1] = 3 --source include/assert.inc --source include/diff_tables.inc --echo --echo # Nothing is updated. --connection server1 --let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1) --error 1062 UPDATE t1 SET c1=4; --source include/rpl_sync.inc --connection server1 --source include/diff_tables.inc --source include/show_binlog_events.inc --echo --echo # Nothing is updated. --connection server1 --error 1062 UPDATE t1, t2 SET t1.c1= 5, t2.c1=5; --source include/rpl_sync.inc --connection server1 --source include/diff_tables.inc --source include/show_binlog_events.inc DROP TABLE t1, t2; --source ../inc/group_replication_end.inc