mirror of
https://github.com/MariaDB/server.git
synced 2025-09-11 05:52:26 +03:00
Bug#30998 Drop View breaks replication if view does not exist
When executing drop view statement on the master, the statement is not written into bin-log if any error occurs, this could cause master slave inconsistence if any view has been dropped. If some error occured and no view has been dropped, don't bin-log the statement, if at least one view has been dropped the query is bin-logged possible with an error. sql/sql_view.cc: If at least one view has been dropped the query is bin-logged possible with an error. mysql-test/suite/rpl/r/rpl_drop_view.result: Add test result for bug#30998 mysql-test/suite/rpl/t/rpl_drop_view.test: Add test case for bug#30998
This commit is contained in:
27
mysql-test/suite/rpl/r/rpl_drop_view.result
Normal file
27
mysql-test/suite/rpl/r/rpl_drop_view.result
Normal file
@@ -0,0 +1,27 @@
|
||||
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, t2;
|
||||
drop view if exists v1, v2, v3, not_exist_view;
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
create view v1 as select * from t1;
|
||||
create view v2 as select * from t2;
|
||||
create view v3 as select * from t3;
|
||||
drop view not_exist_view;
|
||||
ERROR 42S02: Unknown table 'not_exist_view'
|
||||
drop view v1, not_exist_view;
|
||||
ERROR 42S02: Unknown table 'not_exist_view'
|
||||
select * from v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
drop view v2, v3;
|
||||
select * from v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
select * from v2;
|
||||
ERROR 42S02: Table 'test.v2' doesn't exist
|
||||
select * from v3;
|
||||
ERROR 42S02: Table 'test.v3' doesn't exist
|
31
mysql-test/suite/rpl/t/rpl_drop_view.test
Normal file
31
mysql-test/suite/rpl/t/rpl_drop_view.test
Normal file
@@ -0,0 +1,31 @@
|
||||
# test case for bug#30998
|
||||
# Drop View breaks replication if view does not exist
|
||||
#
|
||||
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
drop view if exists v1, v2, v3, not_exist_view;
|
||||
--enable_warnings
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
create view v1 as select * from t1;
|
||||
create view v2 as select * from t2;
|
||||
create view v3 as select * from t3;
|
||||
--error 1051
|
||||
drop view not_exist_view;
|
||||
--error 1051
|
||||
drop view v1, not_exist_view;
|
||||
--error 1146
|
||||
select * from v1;
|
||||
drop view v2, v3;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
--error 1146
|
||||
select * from v1;
|
||||
--error 1146
|
||||
select * from v2;
|
||||
--error 1146
|
||||
select * from v3;
|
Reference in New Issue
Block a user