summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_view.test
blob: 0a0c6a6dddbcc9a0619469671745d0e03eaefe13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
source include/master-slave.inc;
--disable_warnings
drop table if exists t1,v1;
drop view if exists t1,v1;
sync_slave_with_master;
reset master;
--enable_warnings

#
# Check that createion drop of view is replicated, also check replication of
# updating of view
#
connection master;
create table t1 (a int);
insert into t1 values (1);
create view v1 as select a from t1;
insert into v1 values (2);
select * from v1 order by a;
sync_slave_with_master;
# view already have to be on slave
select * from v1 order by a;
connection master;
update v1 set a=3 where a=1;
select * from v1 order by a;
sync_slave_with_master;
select * from v1 order by a;
connection master;
delete from v1 where a=2;
select * from v1 order by a;
sync_slave_with_master;
select * from v1 order by a;
connection master;
# 'alter view' internally maped to creation, but still check that it works
alter view v1 as select a as b from t1;
sync_slave_with_master;
select * from v1 order by 1;
connection master;
drop view v1;
sync_slave_with_master;
#error, because view have to be removed from slave
-- error 1146
select * from v1 order by a;
connection master;
drop table t1;
sync_slave_with_master;
--replace_column 2 # 5 #
show binlog events limit 1,100;