mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-9696: CREATE SERVER statement does not replicate in Galera Cluster
Enable replication of CREATE/ALTER/DROP SERVER statements in Galera cluster.
This commit is contained in:
parent
000f76d886
commit
d31d6d31bb
3 changed files with 54 additions and 0 deletions
20
mysql-test/suite/galera/r/galera_server.result
Normal file
20
mysql-test/suite/galera/r/galera_server.result
Normal file
|
@ -0,0 +1,20 @@
|
|||
# On node_1
|
||||
CREATE SERVER s1
|
||||
FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (HOST 'foo');
|
||||
# On node_2
|
||||
SELECT * FROM mysql.servers;
|
||||
Server_name Host Db Username Password Port Socket Wrapper Owner
|
||||
s1 foo 3306 mysql
|
||||
ALTER SERVER s1
|
||||
OPTIONS (HOST 'bar');
|
||||
# On node_1
|
||||
SELECT * FROM mysql.servers;
|
||||
Server_name Host Db Username Password Port Socket Wrapper Owner
|
||||
s1 bar 3306 mysql
|
||||
DROP SERVER s1;
|
||||
# On node_2
|
||||
SELECT COUNT(*)=0 FROM mysql.servers;
|
||||
COUNT(*)=0
|
||||
1
|
||||
# End of test
|
28
mysql-test/suite/galera/t/galera_server.test
Normal file
28
mysql-test/suite/galera/t/galera_server.test
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Test for CREATE/ALTER/DROP SERVER in Galera cluster
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
|
||||
--connection node_1
|
||||
--echo # On node_1
|
||||
CREATE SERVER s1
|
||||
FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (HOST 'foo');
|
||||
|
||||
--connection node_2
|
||||
--echo # On node_2
|
||||
SELECT * FROM mysql.servers;
|
||||
ALTER SERVER s1
|
||||
OPTIONS (HOST 'bar');
|
||||
|
||||
--connection node_1
|
||||
--echo # On node_1
|
||||
SELECT * FROM mysql.servers;
|
||||
DROP SERVER s1;
|
||||
|
||||
--connection node_2
|
||||
--echo # On node_2
|
||||
SELECT COUNT(*)=0 FROM mysql.servers;
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
|
|
@ -5649,6 +5649,8 @@ create_sp_error:
|
|||
if (check_global_access(thd, SUPER_ACL))
|
||||
break;
|
||||
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
|
||||
|
||||
res= create_server(thd, &lex->server_options);
|
||||
break;
|
||||
}
|
||||
|
@ -5660,6 +5662,8 @@ create_sp_error:
|
|||
if (check_global_access(thd, SUPER_ACL))
|
||||
break;
|
||||
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
|
||||
|
||||
if ((error= alter_server(thd, &lex->server_options)))
|
||||
{
|
||||
DBUG_PRINT("info", ("problem altering server <%s>",
|
||||
|
@ -5678,6 +5682,8 @@ create_sp_error:
|
|||
if (check_global_access(thd, SUPER_ACL))
|
||||
break;
|
||||
|
||||
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
|
||||
|
||||
if ((err_code= drop_server(thd, &lex->server_options)))
|
||||
{
|
||||
if (! lex->if_exists() && err_code == ER_FOREIGN_SERVER_DOESNT_EXIST)
|
||||
|
|
Loading…
Reference in a new issue