Server IP : 172.67.216.182 / Your IP : 162.158.162.39 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 : |
################################################################################ # Validate that Group Replication pre-conditions are # properly checked, in particular the existence of primary # key on tables. # # Test: # 0. The test requires two servers: M1 and M2. # 1. With both the members ONLINE. Create a table t1 without primary key on M1. # Sync data in the group. # 2. Execute a query on the table on M1 that will fail on pre-conditions check. # 3. Check that table t1 is empty on M1. # 4. Check that table t1 is empty on M2. # 5. Clean up. ################################################################################ --let $group_replication_group_name= 8a94f357-aab4-11df-86ab-c80aa9420003 --source ../inc/have_group_replication_plugin.inc --source ../inc/group_replication.inc --echo --echo ############################################################ --echo # 1. Create the test table without primary key on all group --echo # members. --connection server1 CREATE TABLE `t1` ( `col_bit_64` bit(64), `col_varchar_255_utf8_key` varchar(255) CHARACTER SET utf8, `col_bigint` bigint, `col_varchar_255_binary_key` varchar(255) CHARACTER SET binary, `col_varchar_255_utf8` varchar(255) CHARACTER SET utf8, `col_text_utf8` text CHARACTER SET utf8, `col_set_binary_key` set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') CHARACTER SET binary, `col_text_binary` text CHARACTER SET binary, `col_varchar_255_binary` varchar(255) CHARACTER SET binary, `col_bigint_key` bigint, `col_set_utf8` set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') CHARACTER SET utf8, `col_text_binary_key` text CHARACTER SET binary, `col_set_binary` set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') CHARACTER SET binary, `col_set_utf8_key` set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') CHARACTER SET utf8, `col_text_utf8_key` text CHARACTER SET utf8, `col_bit_64_key` bit(64), key (`col_varchar_255_utf8_key`), key (`col_varchar_255_binary_key`), key (`col_set_binary_key`), key (`col_bigint_key`), key (`col_text_binary_key`(255)), key (`col_set_utf8_key`), key (`col_text_utf8_key` (255)), key (`col_bit_64_key`) ) ENGINE=InnoDB; --source include/rpl_sync.inc --echo --echo ############################################################ --echo # 2. Execute a query on the table without primary key on --echo # server 1 that will fail on pre-conditions check. --connection server1 SET SESSION sql_log_bin= 0; call mtr.add_suppression("Plugin group_replication reported: 'Table t1 does not have any PRIMARY KEY. This is not compatible with Group Replication'"); SET SESSION sql_log_bin= 1; --error ER_BEFORE_DML_VALIDATION_ERROR INSERT /*! IGNORE */ INTO t1 VALUES (NULL, NULL, -1188668826649100288, 'x', NULL, 'can\'t', 'p', 'didn\'t', 'we', 8, 'what', 'who', NULL, 'can', 'not', 1); --echo --echo ############################################################ --echo # 3. Check that table t1 is empty on server 1. --connection server1 --let $assert_text= 'Table t1 is empty' --let $assert_cond= [SELECT COUNT(*) AS count FROM t1, count, 1] = 0 --source include/assert.inc --echo --echo ############################################################ --echo # 4. Check that table t1 is empty on server 2. --connection server2 --let $assert_text= 'Table t1 is empty' --let $assert_cond= [SELECT COUNT(*) AS count FROM t1, count, 1] = 0 --source include/assert.inc --echo --echo ############################################################ --echo # 5. Clean data. --connection server1 DROP TABLE t1; --source ../inc/group_replication_end.inc