mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
df35f2c353
When executing drop view statement on the master, the statement is written into bin-log without checking for possible errors, so the statement would always be bin-logged with error code cleared even if some error might occur, for example, some of the views being dropped does not exist. This would cause failure on the slave. Writing bin-log after check for errors, if at least one view has been dropped the query is bin-logged possible with an error. sql/sql_view.cc: Writing bin-log after check for errors, if at least one view has been dropped the query is bin-logged possible with an error. mysql-test/r/rpl_drop_view.result: Add test result for bug#30998 mysql-test/t/rpl_drop_view.test: Add test for bug#30998
31 lines
690 B
Text
31 lines
690 B
Text
# 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;
|