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
44
select * from v1 order by a;
47
sync_slave_with_master;
49
# Change Date: 2005-12-22
50
# Change: Commented out binlog events to work with SBR and RBR
51
#--replace_column 2 # 5 #
52
# show binlog events limit 1,100;
55
# BUG#20438: CREATE statements for views, stored routines and triggers can be
60
--echo ---> Test for BUG#20438
62
# Prepare environment.
65
--echo ---> Preparing environment...
66
--echo ---> connection: master
70
DROP TABLE IF EXISTS t1;
71
DROP VIEW IF EXISTS v1;
75
--echo ---> Synchronizing slave with master...
82
--echo ---> connection: master
88
--echo ---> Creating objects...
90
CREATE TABLE t1(c INT);
92
/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
95
--echo ---> Inserting value...
97
INSERT INTO t1 VALUES(1);
100
--echo ---> Checking on master...
105
--echo ---> Synchronizing slave with master...
111
--echo ---> connection: master
114
--echo ---> Checking on slave...
121
--echo ---> connection: master
125
--echo ---> Cleaning up...
136
# BUG#19419: "VIEW: View that the column name is different
137
# by master and slave is made".
140
create table t1(a int, b int);
141
insert into t1 values (1, 1), (1, 2), (1, 3);
142
create view v1(a, b) as select a, sum(b) from t1 group by a;
144
sync_slave_with_master;
146
show create table v1;
153
sync_slave_with_master;
156
# BUG#28244 CREATE VIEW breaks replication when view exists
159
CREATE TABLE t1(a INT);
160
CREATE VIEW v1 AS SELECT * FROM t1;
161
--error ER_TABLE_EXISTS_ERROR
162
CREATE VIEW v1 AS SELECT * FROM t1;
165
sync_slave_with_master;
167
--echo End of 5.0 tests