189 lines
6.5 KiB
Plaintext
189 lines
6.5 KiB
Plaintext
###############################################################################
|
|
# WL#11610
|
|
# Perform some simple tests about getting/setting communication_protocol.
|
|
#
|
|
# This test uses 2 servers.
|
|
#
|
|
# Test:
|
|
# 1. Start 2 servers and add them into group replication group.
|
|
# 2. Decrease communication_protocol.
|
|
# 3. Increase communication_protocol.
|
|
# 4. Confirm invalid calls to group_replication_get_communication_protocol.
|
|
# 5. Confirm invalid calls to group_replication_set_communication_protocol.
|
|
# 6. Stop GR and try to call UDFs outside of a group.
|
|
################################################################################
|
|
--source include/have_group_replication_plugin.inc
|
|
--let $rpl_server_count= 2
|
|
--source include/group_replication.inc
|
|
|
|
# Create table with strings to test UDF further down.
|
|
SET SQL_LOG_BIN=0;
|
|
CREATE TABLE t1 (i INT, s VARCHAR(16), PRIMARY KEY (i));
|
|
INSERT INTO t1 VALUES (1, NULL);
|
|
INSERT INTO t1 VALUES (2, "");
|
|
INSERT INTO t1 VALUES (3, "5");
|
|
INSERT INTO t1 VALUES (4, "5.7");
|
|
INSERT INTO t1 VALUES (5, "5.7.14a");
|
|
INSERT INTO t1 VALUES (6, "5.7.13");
|
|
INSERT INTO t1 VALUES (7, "99.99.99");
|
|
SET SQL_LOG_BIN=1;
|
|
|
|
# Will be used to hide the version of the server later on.
|
|
--let $mysql_version= `SELECT SUBSTRING_INDEX(VERSION(), '-', 1)`
|
|
|
|
--echo ###############################################################################
|
|
--echo # 2. Decrease communication_protocol.
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
--let $gr_new_protocol= 5.7.14
|
|
|
|
--eval SELECT group_replication_set_communication_protocol("$gr_new_protocol")
|
|
|
|
--let $gr_protocol= `SELECT group_replication_get_communication_protocol()`
|
|
--let $assert_text= communication_protocol is supposed to be $gr_new_protocol
|
|
--let $assert_cond= "$gr_protocol" = "$gr_new_protocol"
|
|
--source include/assert.inc
|
|
|
|
--let $rpl_connection_name= server2
|
|
--source include/rpl_connection.inc
|
|
|
|
--let $gr_protocol= `SELECT group_replication_get_communication_protocol()`
|
|
--let $assert_text= communication_protocol is supposed to be $gr_new_protocol
|
|
--let $assert_cond= "$gr_protocol" = "$gr_new_protocol"
|
|
--source include/assert.inc
|
|
|
|
--echo ###############################################################################
|
|
--echo # 3. Increase communication_protocol.
|
|
--let $gr_new_protocol= 8.0.16
|
|
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
--eval SELECT group_replication_set_communication_protocol("$gr_new_protocol")
|
|
|
|
--let $gr_protocol= `SELECT group_replication_get_communication_protocol()`
|
|
--let $assert_text= communication_protocol is supposed to be $gr_new_protocol
|
|
--let $assert_cond= "$gr_protocol" = "$gr_new_protocol"
|
|
--source include/assert.inc
|
|
|
|
--let $rpl_connection_name= server2
|
|
--source include/rpl_connection.inc
|
|
|
|
--let $gr_protocol= `SELECT group_replication_get_communication_protocol()`
|
|
--let $assert_text= communication_protocol is supposed to be $gr_new_protocol
|
|
--let $assert_cond= "$gr_protocol" = "$gr_new_protocol"
|
|
--source include/assert.inc
|
|
|
|
--echo ###############################################################################
|
|
--echo # 4. Confirm invalid calls to group_replication_get_communication_protocol
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_get_communication_protocol(1);
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_get_communication_protocol(1.1);
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_get_communication_protocol("hehe");
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_get_communication_protocol(NULL);
|
|
|
|
--echo ###############################################################################
|
|
--echo # 5. Confirm invalid calls to group_replication_set_communication_protocol
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol();
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol(NULL);
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol(1);
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol(5.7);
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol("");
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol(" ");
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol("5");
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol("5.7");
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol("5.7.14a");
|
|
|
|
# Out of [5.7.14, this-mysql-version] domain
|
|
# We are using 99.99.99 as a placeholder for a version > than this-mysql-version
|
|
--replace_result $mysql_version MYSQL_VERSION
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol("5.7.13");
|
|
|
|
--replace_result $mysql_version MYSQL_VERSION
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol("99.99.99");
|
|
|
|
# With dynamic arguments, the error returned is ER_GRP_RPL_UDF_ERROR
|
|
|
|
# NULL
|
|
--error ER_GRP_RPL_UDF_ERROR
|
|
SELECT group_replication_set_communication_protocol(s) FROM test.t1 WHERE i=1;
|
|
|
|
# Empty
|
|
--error ER_GRP_RPL_UDF_ERROR
|
|
SELECT group_replication_set_communication_protocol(s) FROM test.t1 WHERE i=2;
|
|
|
|
# 5
|
|
--error ER_GRP_RPL_UDF_ERROR
|
|
SELECT group_replication_set_communication_protocol(s) FROM test.t1 WHERE i=3;
|
|
|
|
# 5.7
|
|
--error ER_GRP_RPL_UDF_ERROR
|
|
SELECT group_replication_set_communication_protocol(s) FROM test.t1 WHERE i=4;
|
|
|
|
#5.7.14a
|
|
--error ER_GRP_RPL_UDF_ERROR
|
|
SELECT group_replication_set_communication_protocol(s) FROM test.t1 WHERE i=5;
|
|
|
|
#5.7.13
|
|
--replace_result $mysql_version MYSQL_VERSION
|
|
--error ER_GRP_RPL_UDF_ERROR
|
|
SELECT group_replication_set_communication_protocol(s) FROM test.t1 WHERE i=6;
|
|
|
|
#99.99.99
|
|
--replace_result $mysql_version MYSQL_VERSION
|
|
--error ER_GRP_RPL_UDF_ERROR
|
|
SELECT group_replication_set_communication_protocol(s) FROM test.t1 WHERE i=7;
|
|
|
|
|
|
# Stop GR on server2
|
|
--let $rpl_connection_name= server2
|
|
--source include/rpl_connection.inc
|
|
--source include/stop_group_replication.inc
|
|
|
|
--echo ###############################################################################
|
|
--echo # 6. Stop GR and try to call UDFs outside of a group
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
# Cleanup.
|
|
SET SQL_LOG_BIN=0;
|
|
DROP TABLE t1;
|
|
SET SQL_LOG_BIN=1;
|
|
|
|
--source include/group_replication_end.inc
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_get_communication_protocol();
|
|
|
|
--error ER_CANT_INITIALIZE_UDF
|
|
SELECT group_replication_set_communication_protocol("5.7.14");
|