Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_cascade_fk.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection server1]
6
7 ############################################################
8 # 1. Bootstrap group on server1, which will be the primary.
9 [connection server1]
10 include/start_and_bootstrap_group_replication.inc
11 CREATE TABLE tp1 (c1 char(10) NOT NULL PRIMARY KEY);
12 CREATE TABLE tc1 (c1 char(10) NOT NULL PRIMARY KEY,
13 FOREIGN KEY (c1) REFERENCES tp1(c1) ON DELETE CASCADE ON UPDATE RESTRICT);
14
15 ############################################################
16 # 2. Add a second member to the group.
17 [connection server2]
18 include/start_group_replication.inc
19
20 ############################################################
21 # 3. Start a transaction that has cascading FK on the primary.
22 [connection server_1]
23 BEGIN;
24 INSERT INTO tp1 VALUES('a');
25 INSERT INTO tp1 VALUES('b');
26 INSERT INTO tc1 VALUES('a');
27 UPDATE tc1 SET c1 = 'b';
28
29 ############################################################
30 # 4. Start group mode change to multi-primary on the primary.
31 [connection server1]
32 SELECT group_replication_switch_to_multi_primary_mode();
33 [connection server_1]
34
35 ############################################################
36 # 5. While group action is ongoing on server1, server2 already
37 # changed group_replication_enforce_update_everywhere_checks
38 # but has super_read_only enabled.
39 [connection server2]
40 include/assert.inc [group_replication_enforce_update_everywhere_checks is ON]
41 include/assert.inc [The super_read_only mode must be 1 here.]
42
43 ############################################################
44 # 6. Complete the ongoing transaction.
45 [connection server_1]
46 COMMIT;
47
48 ############################################################
49 # 7. Successful termination of the group change.
50 [connection server1]
51 group_replication_switch_to_multi_primary_mode()
52 Mode switched to multi-primary successfully.
53 include/gr_assert_multi_primary_mode.inc
54 [connection server2]
55 include/gr_assert_multi_primary_mode.inc
56 include/rpl_sync.inc
57 include/diff_tables.inc [server1:tp1, server2:tp1]
58 include/diff_tables.inc [server1:tc1, server2:tc1]
59
60 ############################################################
61 # 8. Clean up.
62 DROP TABLE tc1;
63 DROP TABLE tp1;
64 include/group_replication_end.inc