Debian Codegraph @

mysql-test/suite/group_replication/r/gr_start_stop_no_autocommit.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. Create a table on server 1 without generating GTID to
9 # avoid confusion on the test asserts.
10 [connection server1]
11 SET SESSION sql_log_bin = 0;
12 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
13 SET SESSION sql_log_bin = 1;
14
15 ############################################################
16 # 2. Deploy a group on server1 with autocommit disabled and
17 # super_read_only is enabled.
18 [connection server1]
19 SET GLOBAL group_replication_group_name= "GROUP_REPLICATION_GROUP_NAME";
20 SET @@GLOBAL.super_read_only= 1;
21 SET @saved_autocommit = @@SESSION.autocommit;
22 SET @@SESSION.autocommit = 0;
23 START GROUP_REPLICATION;
24 COMMIT;
25
26 ############################################################
27 # 3. Assert that a View_change_log_event was logged.
28 [connection server1]
29 include/gr_wait_for_member_state.inc
30 include/assert.inc [START GROUP_REPLICATION did generate a GTID]
31 include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT]
32
33 ############################################################
34 # 4. Stop Group Replication on server1 with autocommit disabled
35 # and super_read_only is enabled.
36 [connection server1]
37 SET @@GLOBAL.super_read_only= 1;
38 SET @@SESSION.autocommit = 0;
39 STOP GROUP_REPLICATION;
40 COMMIT;
41
42 ############################################################
43 # 5. Assert that no transaction was logged due to
44 # STOP GROUP_REPLICATION;
45 [connection server1]
46 include/gr_wait_for_member_state.inc
47 include/assert.inc [STOP GROUP_REPLICATION did not generate a GTID]
48 include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT]
49
50 ############################################################
51 # 6. Assert that no transaction was logged due to
52 # STOP GROUP_REPLICATION and that a statement cannot be
53 # be executed between STOP GROUP_REPLICATION and COMMIT
54 # when autocommit is disabled.
55 [connection server1]
56 include/start_and_bootstrap_group_replication.inc
57 include/assert.inc [START GROUP_REPLICATION did generate a GTID]
58 include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT # Gtid # Query/BEGIN # View_change # Query/COMMIT]
59 SET @@GLOBAL.read_only= 0;
60 SET @@SESSION.autocommit = 0;
61 STOP GROUP_REPLICATION;
62 INSERT INTO t1 VALUES (1);
63 ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement
64 COMMIT;
65 include/assert.inc [STOP GROUP_REPLICATION did not generate a GTID]
66 include/assert_binlog_events.inc [Gtid # Query/BEGIN # View_change # Query/COMMIT # Gtid # Query/BEGIN # View_change # Query/COMMIT]
67 include/assert.inc ['Table t1 must be empty']
68
69 ############################################################
70 # 7. Clean up.
71 [connection server1]
72 SET @@SESSION.autocommit = @saved_autocommit;
73 SET @@GLOBAL.read_only= 0;
74 SET SESSION sql_log_bin = 0;
75 DROP TABLE t1;
76 SET SESSION sql_log_bin = 1;
77 include/group_replication_end.inc