1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-30 05:23:50 +03:00
Files
mariadb/mysql-test/suite/galera/t/galera_var_wsrep_mode.test
Jan Lindström ebb2db5912 MDEV-20715 : Implement system variable to disallow local GTIDs in Galera
Added a new wsrep_mode feature DISALLOW_LOCAL_GTID for this.
Nodes can have GTIDs for local transactions in the following scenarios:

A DDL statement is executed with wsrep_OSU_method=RSU set.
A DML statement writes to a non-InnoDB table.
A DML statement writes to an InnoDB table with wsrep_on=OFF set.

If user has set wsrep_mode=DISALLOW_LOCAL_GTID these operations
produce a error ERROR HY000: Galera replication not supported
2021-03-01 15:21:31 +02:00

66 lines
1.6 KiB
Plaintext

--source include/galera_cluster.inc
# default
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=DEFAULT;
SELECT @@wsrep_mode;
--error ER_GLOBAL_VARIABLE
SET SESSION wsrep_mode=DEFAULT;
SELECT @@global.wsrep_mode;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_mode;
#
# Incorrect input
#
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL wsrep_mode=A;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL wsrep_mode='A';
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL wsrep_mode=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL wsrep_mode=64;
--error ER_PARSE_ERROR
SET GLOBAL wsrep_mode=REQUIRED_PRIMARY_KEY,REPLICATE_MYISAM;
#
# Correct input
#
SET GLOBAL wsrep_mode=1;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=32;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode='';
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=STRICT_REPLICATION;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=BINLOG_ROW_FORMAT_ONLY;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=REQUIRED_PRIMARY_KEY;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=REPLICATE_MYISAM;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=REPLICATE_ARIA;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode=DISALLOW_LOCAL_GTID;
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode='STRICT_REPLICATION,BINLOG_ROW_FORMAT_ONLY';
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode='STRICT_REPLICATION,BINLOG_ROW_FORMAT_ONLY,REQUIRED_PRIMARY_KEY,REPLICATE_MYISAM,REPLICATE_ARIA,DISALLOW_LOCAL_GTID';
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode='BINLOG_ROW_FORMAT_ONLY,STRICT_REPLICATION';
SELECT @@wsrep_mode;
SET GLOBAL wsrep_mode='STRICT_REPLICATION,REQUIRED_PRIMARY_KEY,REPLICATE_ARIA,DISALLOW_LOCAL_GTID';
SELECT @@wsrep_mode;
# reset
SET GLOBAL wsrep_mode=DEFAULT;