1
# NYI - row-based cannot use CREATE ... SELECT
3
source include/master-slave.inc;
5
drop table if exists t1,v1;
6
drop view if exists t1,v1;
7
sync_slave_with_master;
12
# Check that creation drop of view is replicated, also check replication of
16
create table t1 (a int);
17
insert into t1 values (1);
18
create view v1 as select a from t1;
19
insert into v1 values (2);
20
select * from v1 order by a;
21
sync_slave_with_master;
22
# view already have to be on slave
23
select * from v1 order by a;
25
update v1 set a=3 where a=1;
26
select * from v1 order by a;
27
sync_slave_with_master;
28
select * from v1 order by a;
30
delete from v1 where a=2;
31
select * from v1 order by a;
32
sync_slave_with_master;
33
select * from v1 order by a;
35
# 'alter view' internally maped to creation, but still check that it works
36
alter view v1 as select a as b from t1;
37
sync_slave_with_master;
38
select * from v1 order by 1;
41
sync_slave_with_master;
42
#error, because view have to be removed from slave
43
select * from v1 order by a;
46
sync_slave_with_master;
48
# Change Date: 2005-12-22
49
# Change: Commented out binlog events to work with SBR and RBR
50
#--replace_column 2 # 5 #
51
# show binlog events limit 1,100;
54
# BUG#20438: CREATE statements for views, stored routines and triggers can be
59
--echo ---> Test for BUG#20438
61
# Prepare environment.
64
--echo ---> Preparing environment...
65
--echo ---> connection: master
69
DROP TABLE IF EXISTS t1;
70
DROP VIEW IF EXISTS v1;
74
--echo ---> Synchronizing slave with master...
81
--echo ---> connection: master
87
--echo ---> Creating objects...
89
CREATE TABLE t1(c INT);
91
/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
94
--echo ---> Inserting value...
96
INSERT INTO t1 VALUES(1);
99
--echo ---> Checking on master...
104
--echo ---> Synchronizing slave with master...
110
--echo ---> connection: master
113
--echo ---> Checking on slave...
120
--echo ---> connection: master
124
--echo ---> Cleaning up...
135
# BUG#19419: "VIEW: View that the column name is different
136
# by master and slave is made".
139
create table t1(a int, b int);
140
insert into t1 values (1, 1), (1, 2), (1, 3);
141
create view v1(a, b) as select a, sum(b) from t1 group by a;
143
sync_slave_with_master;
145
show create table v1;
152
sync_slave_with_master;
155
# BUG#28244 CREATE VIEW breaks replication when view exists
158
CREATE TABLE t1(a INT);
159
CREATE VIEW v1 AS SELECT * FROM t1;
160
--error ER_TABLE_EXISTS_ERROR
161
CREATE VIEW v1 AS SELECT * FROM t1;
164
sync_slave_with_master;
166
--echo End of 5.0 tests