rpl_stm_view.result 1.54 KB
Newer Older
1 2 3 4 5 6 7 8
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1,v1;
drop view if exists t1,v1;
9
reset master;
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
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;
a
1
2
select * from v1 order by a;
a
1
2
update v1 set a=3 where a=1;
select * from v1 order by a;
a
2
3
select * from v1 order by a;
a
2
3
delete from v1 where a=2;
select * from v1 order by a;
a
3
select * from v1 order by a;
a
3
alter view v1 as select a as b from t1;
select * from v1 order by 1;
b
3
drop view v1;
select * from v1 order by a;
ERROR 42S02: Table 'test.v1' doesn't exist
drop table t1;
bell@sanja.is.com.ua's avatar
bell@sanja.is.com.ua committed
46
show binlog events limit 1,100;
47 48 49 50 51 52 53 54 55 56
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
slave-bin.000001	#	Query	1	#	use `test`; create table t1 (a int)
slave-bin.000001	#	Query	1	#	use `test`; insert into t1 values (1)
slave-bin.000001	#	Query	1	#	use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a from t1
slave-bin.000001	#	Query	1	#	use `test`; insert into v1 values (2)
slave-bin.000001	#	Query	1	#	use `test`; update v1 set a=3 where a=1
slave-bin.000001	#	Query	1	#	use `test`; delete from v1 where a=2
slave-bin.000001	#	Query	1	#	use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a as b from t1
slave-bin.000001	#	Query	1	#	use `test`; drop view v1
slave-bin.000001	#	Query	1	#	use `test`; drop table t1