Debian Codegraph @

mysql-test/suite/rpl/r/rpl_alter_db.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 ==== Verify that alter database does not stop replication ====
7 create database temp_db;
8 use temp_db;
9 show create schema temp_db;
10 Database Create Database
11 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */
12 [connection slave]
13 show create schema temp_db;
14 Database Create Database
15 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */
16 ==== Replication of default collation ====
17 [connection master]
18 alter database collate latin1_bin;
19 show create schema temp_db;
20 Database Create Database
21 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */
22 [connection slave]
23 show create schema temp_db;
24 Database Create Database
25 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */
26 ==== Replication of read only ====
27 [connection master]
28 create table temp_db.t(i int);
29 alter schema temp_db read only=1;
30 insert into temp_db.t values(1);
31 ERROR HY000: Schema 'temp_db' is in read only mode.
32 show create schema temp_db;
33 Database Create Database
34 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */ /* READ ONLY = 1 */
35 [connection slave]
36 insert into temp_db.t values(2);
37 ERROR HY000: Schema 'temp_db' is in read only mode.
38 show create schema temp_db;
39 Database Create Database
40 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */ /* READ ONLY = 1 */
41 [connection master]
42 alter schema temp_db read only=0;
43 insert into temp_db.t values(1);
44 show create schema temp_db;
45 Database Create Database
46 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */
47 [connection slave]
48 show create schema temp_db;
49 Database Create Database
50 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */
51 insert into temp_db.t values(2);
52 select * from temp_db.t;
53 i
54 1
55 2
56 show create schema temp_db;
57 Database Create Database
58 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */
59 ==== No replication of read only when turning off binlog ====
60 [connection master]
61 drop table temp_db.t;
62 create table temp_db.t(i int);
63 set sql_log_bin = 0;
64 alter schema temp_db read only=1;
65 set sql_log_bin = 1;
66 show create schema temp_db;
67 Database Create Database
68 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */ /* READ ONLY = 1 */
69 insert into temp_db.t values(1);
70 ERROR HY000: Schema 'temp_db' is in read only mode.
71 [connection slave]
72 show create schema temp_db;
73 Database Create Database
74 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */
75 insert into temp_db.t values(2);
76 select * from temp_db.t;
77 i
78 2
79 [connection master]
80 set sql_log_bin = 0;
81 alter schema temp_db read only=0;
82 set sql_log_bin = 1;
83 alter schema temp_db read only=1 collate utf8mb4_0900_ai_ci;
84 show create schema temp_db;
85 Database Create Database
86 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */ /* READ ONLY = 1 */
87 [connection slave]
88 select * from temp_db.t;
89 i
90 2
91 show create schema temp_db;
92 Database Create Database
93 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */ /* READ ONLY = 1 */
94 ==== Slave schema read only will not affect replication ====
95 [connection master]
96 set sql_log_bin = 0;
97 alter schema temp_db read only=0;
98 set sql_log_bin = 1;
99 alter schema temp_db collate latin1_bin;
100 show create schema temp_db;
101 Database Create Database
102 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */
103 drop table temp_db.t;
104 create table temp_db.t(i int);
105 insert into temp_db.t values(1);
106 [connection slave]
107 show create schema temp_db;
108 Database Create Database
109 temp_db CREATE DATABASE `temp_db` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */ /* READ ONLY = 1 */
110 insert into temp_db.t values(2);
111 ERROR HY000: Schema 'temp_db' is in read only mode.
112 select * from temp_db.t;
113 i
114 1
115 ==== Clean up ====
116 [connection master]
117 drop database temp_db;
118 include/sync_slave_sql_with_master.inc
119 include/rpl_end.inc