MDEV-6409 CREATE VIEW replication problem if error occurs in mysql_register_view
fix by Sriram Patil
This commit is contained in:
parent
c104965746
commit
1907bf042a
15
mysql-test/suite/rpl/r/failed_create_view-6409.result
Normal file
15
mysql-test/suite/rpl/r/failed_create_view-6409.result
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
create table v1 (a int);
|
||||||
|
include/master-slave.inc
|
||||||
|
[connection master]
|
||||||
|
create table t1 (a int);
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
ERROR 42S01: Table 'v1' already exists
|
||||||
|
show tables;
|
||||||
|
Tables_in_test
|
||||||
|
t1
|
||||||
|
v1
|
||||||
|
show tables;
|
||||||
|
Tables_in_test
|
||||||
|
t1
|
||||||
|
drop table if exists t1, v1;
|
||||||
|
include/rpl_end.inc
|
24
mysql-test/suite/rpl/t/failed_create_view-6409.test
Normal file
24
mysql-test/suite/rpl/t/failed_create_view-6409.test
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# MDEV-6409 CREATE VIEW replication problem if error occurs in mysql_register_view
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# verify that failed CREATE VIEW is not replicated
|
||||||
|
|
||||||
|
create table v1 (a int);
|
||||||
|
|
||||||
|
source include/master-slave.inc;
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
create table t1 (a int);
|
||||||
|
--error ER_TABLE_EXISTS_ERROR
|
||||||
|
create view v1 as select * from t1;
|
||||||
|
show tables;
|
||||||
|
sync_slave_with_master;
|
||||||
|
show tables;
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
drop table if exists t1, v1;
|
||||||
|
|
||||||
|
--source include/rpl_end.inc
|
@ -39,8 +39,7 @@
|
|||||||
|
|
||||||
const LEX_STRING view_type= { C_STRING_WITH_LEN("VIEW") };
|
const LEX_STRING view_type= { C_STRING_WITH_LEN("VIEW") };
|
||||||
|
|
||||||
static int mysql_register_view(THD *thd, TABLE_LIST *view,
|
static int mysql_register_view(THD *, TABLE_LIST *, enum_view_create_mode);
|
||||||
enum_view_create_mode mode);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Make a unique name for an anonymous view column
|
Make a unique name for an anonymous view column
|
||||||
@ -670,7 +669,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
|||||||
|
|
||||||
res= mysql_register_view(thd, view, mode);
|
res= mysql_register_view(thd, view, mode);
|
||||||
|
|
||||||
if (mysql_bin_log.is_open())
|
if (!res && mysql_bin_log.is_open())
|
||||||
{
|
{
|
||||||
String buff;
|
String buff;
|
||||||
const LEX_STRING command[3]=
|
const LEX_STRING command[3]=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user