Debian Codegraph @

mysql-test/suite/rpl_nogtid/r/rpl_read_only.result

raw
1 include/master-slave.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 master]
6 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
7 create user test;
8 include/sync_slave_sql_with_master.inc
9 create table t1(a int) engine=InnoDB;
10 insert into t1 values(1001);
11 set global read_only=1;
12 select @@read_only;
13 @@read_only
14 1
15 select * from t1;
16 a
17 1001
18 include/sync_slave_sql_with_master.inc
19 select @@read_only;
20 @@read_only
21 0
22 select * from t1;
23 a
24 1001
25 set global read_only=0;
26 BEGIN;
27 BEGIN;
28 select @@read_only;
29 @@read_only
30 0
31 set global read_only=1;
32 *** On SUPER USER connection ***
33 insert into t1 values(1002);
34 *** On regular USER connection ***
35 insert into t1 values(1003);
36 ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
37 *** SUPER USER COMMIT (must succeed) ***
38 COMMIT;
39 *** regular USER COMMIT (must succeed - nothing to commit) ***
40 COMMIT;
41 select @@read_only;
42 @@read_only
43 1
44 set global read_only=0;
45 insert into t1 values(1004);
46 select * from t1;
47 a
48 1001
49 1002
50 1004
51 include/sync_slave_sql_with_master.inc
52 select * from t1;
53 a
54 1001
55 1002
56 1004
57 set global read_only=1;
58 select @@read_only;
59 @@read_only
60 1
61 show create table t1;
62 Table Create Table
63 t1 CREATE TABLE `t1` (
64 `a` int DEFAULT NULL
65 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
66 insert into t1 values(1005);
67 select * from t1;
68 a
69 1001
70 1002
71 1004
72 1005
73 include/sync_slave_sql_with_master.inc
74 select * from t1;
75 a
76 1001
77 1002
78 1004
79 1005
80 insert into t1 values(1006);
81 ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
82 drop user test;
83 drop table t1;
84 include/sync_slave_sql_with_master.inc
85 set global read_only=0;
86 include/rpl_end.inc