~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_view.result

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
drop table if exists t1,v1;
 
8
drop view if exists t1,v1;
 
9
reset master;
 
10
create table t1 (a int);
 
11
insert into t1 values (1);
 
12
create view v1 as select a from t1;
 
13
insert into v1 values (2);
 
14
select * from v1 order by a;
 
15
a
 
16
1
 
17
2
 
18
select * from v1 order by a;
 
19
a
 
20
1
 
21
2
 
22
update v1 set a=3 where a=1;
 
23
select * from v1 order by a;
 
24
a
 
25
2
 
26
3
 
27
select * from v1 order by a;
 
28
a
 
29
2
 
30
3
 
31
delete from v1 where a=2;
 
32
select * from v1 order by a;
 
33
a
 
34
3
 
35
select * from v1 order by a;
 
36
a
 
37
3
 
38
alter view v1 as select a as b from t1;
 
39
select * from v1 order by 1;
 
40
b
 
41
3
 
42
drop view v1;
 
43
select * from v1 order by a;
 
44
ERROR 42S02: Table 'test.v1' doesn't exist
 
45
drop table t1;
 
46
 
 
47
---> Test for BUG#20438
 
48
 
 
49
---> Preparing environment...
 
50
---> connection: master
 
51
DROP TABLE IF EXISTS t1;
 
52
DROP VIEW IF EXISTS v1;
 
53
 
 
54
---> Synchronizing slave with master...
 
55
 
 
56
---> connection: master
 
57
 
 
58
---> Creating objects...
 
59
CREATE TABLE t1(c INT);
 
60
/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */;
 
61
 
 
62
---> Inserting value...
 
63
INSERT INTO t1 VALUES(1);
 
64
 
 
65
---> Checking on master...
 
66
SELECT * FROM t1;
 
67
c
 
68
1
 
69
 
 
70
---> Synchronizing slave with master...
 
71
---> connection: master
 
72
 
 
73
---> Checking on slave...
 
74
SELECT * FROM t1;
 
75
c
 
76
1
 
77
 
 
78
---> connection: master
 
79
 
 
80
---> Cleaning up...
 
81
DROP VIEW v1;
 
82
DROP TABLE t1;
 
83
create table t1(a int, b int);
 
84
insert into t1 values (1, 1), (1, 2), (1, 3);
 
85
create view  v1(a, b) as select a, sum(b) from t1 group by a;
 
86
explain v1;
 
87
Field   Type    Null    Key     Default Extra
 
88
a       int(11) YES             NULL    
 
89
b       decimal(32,0)   YES             NULL    
 
90
show create table v1;
 
91
View    Create View     character_set_client    collation_connection
 
92
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
 
93
select * from v1;
 
94
a       b
 
95
1       6
 
96
drop table t1;
 
97
drop view v1;
 
98
CREATE TABLE t1(a INT);
 
99
CREATE VIEW v1 AS SELECT * FROM t1;
 
100
CREATE VIEW v1 AS SELECT * FROM t1;
 
101
ERROR 42S01: Table 'v1' already exists
 
102
DROP VIEW v1;
 
103
DROP TABLE t1;
 
104
End of 5.0 tests