~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_view.test

  • Committer: brian
  • Date: 2008-06-29 12:50:19 UTC
  • mfrom: (12.1.4 drizzle)
  • Revision ID: brian@localhost.localdomain-20080629125019-qxk9qma8esphwwus
Committing merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# NYI - row-based cannot use CREATE ... SELECT
2
 
 
3
 
source include/master-slave.inc;
4
 
--disable_warnings
5
 
drop table if exists t1,v1;
6
 
drop view if exists t1,v1;
7
 
sync_slave_with_master;
8
 
reset master;
9
 
--enable_warnings
10
 
 
11
 
#
12
 
# Check that creation drop of view is replicated, also check replication of
13
 
# updating of view
14
 
#
15
 
connection master;
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;
24
 
connection master;
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;
29
 
connection master;
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;
34
 
connection master;
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;
39
 
connection master;
40
 
drop view v1;
41
 
sync_slave_with_master;
42
 
#error, because view have to be removed from slave
43
 
select * from v1 order by a;
44
 
connection master;
45
 
drop table t1;
46
 
sync_slave_with_master;
47
 
# Change Author: JBM
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;
52
 
 
53
 
#
54
 
# BUG#20438: CREATE statements for views, stored routines and triggers can be
55
 
# not replicable.
56
 
#
57
 
 
58
 
--echo
59
 
--echo ---> Test for BUG#20438
60
 
 
61
 
# Prepare environment.
62
 
 
63
 
--echo
64
 
--echo ---> Preparing environment...
65
 
--echo ---> connection: master
66
 
--connection master
67
 
 
68
 
--disable_warnings
69
 
DROP TABLE IF EXISTS t1;
70
 
DROP VIEW IF EXISTS v1;
71
 
--enable_warnings
72
 
 
73
 
--echo
74
 
--echo ---> Synchronizing slave with master...
75
 
 
76
 
--save_master_pos
77
 
--connection slave
78
 
--sync_with_master
79
 
 
80
 
--echo
81
 
--echo ---> connection: master
82
 
--connection master
83
 
 
84
 
# Test.
85
 
 
86
 
--echo
87
 
--echo ---> Creating objects...
88
 
 
89
 
CREATE TABLE t1(c INT);
90
 
 
91
 
/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
92
 
 
93
 
--echo
94
 
--echo ---> Inserting value...
95
 
 
96
 
INSERT INTO t1 VALUES(1);
97
 
 
98
 
--echo
99
 
--echo ---> Checking on master...
100
 
 
101
 
SELECT * FROM t1;
102
 
 
103
 
--echo
104
 
--echo ---> Synchronizing slave with master...
105
 
 
106
 
--save_master_pos
107
 
--connection slave
108
 
--sync_with_master
109
 
 
110
 
--echo ---> connection: master
111
 
 
112
 
--echo
113
 
--echo ---> Checking on slave...
114
 
 
115
 
SELECT * FROM t1;
116
 
 
117
 
# Cleanup.
118
 
 
119
 
--echo
120
 
--echo ---> connection: master
121
 
--connection master
122
 
 
123
 
--echo
124
 
--echo ---> Cleaning up...
125
 
 
126
 
DROP VIEW v1;
127
 
DROP TABLE t1;
128
 
 
129
 
--save_master_pos
130
 
--connection slave
131
 
--sync_with_master
132
 
--connection master
133
 
 
134
 
#
135
 
# BUG#19419: "VIEW: View that the column name is different
136
 
#             by master and slave is made".
137
 
#
138
 
connection master;
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;
142
 
 
143
 
sync_slave_with_master;
144
 
explain v1;
145
 
show create table v1;
146
 
select * from v1;
147
 
 
148
 
connection master;
149
 
drop table t1;
150
 
drop view v1;
151
 
 
152
 
sync_slave_with_master;
153
 
 
154
 
#
155
 
# BUG#28244 CREATE VIEW breaks replication when view exists
156
 
#
157
 
connection master;
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;
162
 
DROP VIEW v1;
163
 
DROP TABLE t1;
164
 
sync_slave_with_master;
165
 
 
166
 
--echo End of 5.0 tests