Debian Codegraph @

mysql-test/suite/engines/funcs/r/rpl_view.result

raw
1 include/master-slave.inc
2 [connection master]
3 drop table if exists t1,v1;
4 drop view if exists t1,v1;
5 connection slave;
6 reset master;
7 connection master;
8 create table t1 (a int);
9 insert into t1 values (1);
10 create view v1 as select a from t1;
11 insert into v1 values (2);
12 select * from v1 order by a;
13 a
14 1
15 2
16 connection slave;
17 select * from v1 order by a;
18 a
19 1
20 2
21 connection master;
22 update v1 set a=3 where a=1;
23 select * from v1 order by a;
24 a
25 2
26 3
27 connection slave;
28 select * from v1 order by a;
29 a
30 2
31 3
32 connection master;
33 delete from v1 where a=2;
34 select * from v1 order by a;
35 a
36 3
37 connection slave;
38 select * from v1 order by a;
39 a
40 3
41 connection master;
42 alter view v1 as select a as b from t1;
43 connection slave;
44 select * from v1 order by 1;
45 b
46 3
47 connection master;
48 drop view v1;
49 connection slave;
50 select * from v1 order by a;
51 ERROR 42S02: Table 'test.v1' doesn't exist
52 connection master;
53 drop table t1;
54 connection slave;
55
56 ---> Test for BUG#20438
57
58 ---> Preparing environment...
59 connection master;
60 DROP TABLE IF EXISTS t1;
61 DROP VIEW IF EXISTS v1;
62
63 ---> Synchronizing slave with master...
64 connection slave;
65
66 connection master;
67
68 ---> Creating objects...
69 CREATE TABLE t1(c INT);
70 /*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
71
72 ---> Inserting value...
73 INSERT INTO t1 VALUES(1);
74
75 ---> Checking on master...
76 SELECT * FROM t1;
77 c
78 1
79
80 ---> Synchronizing slave with master...
81 connection slave;
82 SELECT * FROM t1;
83 c
84 1
85 connection master;
86
87 ---> Cleaning up...
88 DROP VIEW v1;
89 DROP TABLE t1;
90 connection slave;
91 connection master;
92 connection master;
93 create table t1(a int, b int);
94 insert into t1 values (1, 1), (1, 2), (1, 3);
95 create view v1(a, b) as select a, sum(b) from t1 group by a;
96 connection slave;
97 explain v1;
98 Field Type Null Key Default Extra
99 a int(11) YES NULL
100 b decimal(32,0) YES NULL
101 show create table v1;
102 View Create View character_set_client collation_connection
103 v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a` latin1 latin1_swedish_ci
104 select * from v1;
105 a b
106 1 6
107 connection master;
108 drop table t1;
109 drop view v1;
110 connection slave;
111 connection master;
112 CREATE TABLE t1(a INT);
113 CREATE VIEW v1 AS SELECT * FROM t1;
114 CREATE VIEW v1 AS SELECT * FROM t1;
115 ERROR 42S01: Table 'v1' already exists
116 DROP VIEW v1;
117 DROP TABLE t1;
118 connection slave;
119 connection master;
120 CREATE TABLE t1 (a INT);
121 # create view as output from mysqldump 10.11 (5.0.62)
122 /*!50001 CREATE ALGORITHM=UNDEFINED */
123 /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
124 /*!50001 VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) */
125 /*!50002 WITH CASCADED CHECK OPTION */;
126 SHOW CREATE VIEW v1;
127 View Create View character_set_client collation_connection
128 v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
129 connection slave;
130 SHOW CREATE VIEW v1;
131 View Create View character_set_client collation_connection
132 v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
133 connection master;
134 DROP VIEW v1;
135 DROP TABLE t1;
136 connection slave;
137 End of 5.0 tests
138 include/rpl_end.inc