mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Add a basic MTR test for DDL error voting to ensure that all DDLs
generate consistent error messages, Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
This commit is contained in:
parent
731a5aba0b
commit
83196a7b23
3 changed files with 158 additions and 0 deletions
70
mysql-test/suite/galera/r/galera_vote_ddl.result
Normal file
70
mysql-test/suite/galera/r/galera_vote_ddl.result
Normal file
|
@ -0,0 +1,70 @@
|
|||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
SET @@global.wsrep_ignore_apply_errors = 7;
|
||||
connection node_2;
|
||||
SET @@global.wsrep_ignore_apply_errors = 7;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||
connection node_1;
|
||||
DROP TABLE nonexistent;
|
||||
ERROR 42S02: Unknown table 'test.nonexistent'
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
TRUNCATE TABLE nonexistent;
|
||||
ERROR 42S02: Table 'test.nonexistent' doesn't exist
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
CREATE TABLE nonexistent.t1 (s INT);
|
||||
ERROR 42000: Unknown database 'nonexistent'
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (s INT);
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
ALTER TABLE nonexistent ADD COLUMN (c INT);
|
||||
ERROR 42S02: Table 'test.nonexistent' doesn't exist
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
DROP TABLE t1;
|
||||
connection node_1;
|
||||
SET @@global.wsrep_ignore_apply_errors = 0;
|
||||
connection node_2;
|
||||
SET @@global.wsrep_ignore_apply_errors = 0;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||
connection node_1;
|
||||
DROP TABLE nonexistent;
|
||||
ERROR 42S02: Unknown table 'test.nonexistent'
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
TRUNCATE TABLE nonexistent;
|
||||
ERROR 42S02: Table 'test.nonexistent' doesn't exist
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
CREATE TABLE nonexistent.t1 (s INT);
|
||||
ERROR 42000: Unknown database 'nonexistent'
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (s INT);
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
ALTER TABLE nonexistent ADD COLUMN (c INT);
|
||||
ERROR 42S02: Table 'test.nonexistent' doesn't exist
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
connection node_2;
|
||||
DROP TABLE t1;
|
||||
connection node_1;
|
||||
SET @@global.wsrep_ignore_apply_errors = 7;
|
||||
connection node_2;
|
||||
SET @@global.wsrep_ignore_apply_errors = 7;
|
54
mysql-test/suite/galera/t/galera_vote_ddl.inc
Normal file
54
mysql-test/suite/galera/t/galera_vote_ddl.inc
Normal file
|
@ -0,0 +1,54 @@
|
|||
--connection node_1
|
||||
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||
|
||||
--connection node_1
|
||||
--error 1051
|
||||
DROP TABLE nonexistent;
|
||||
|
||||
# Verify cluster is intact
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
--error 1146
|
||||
TRUNCATE TABLE nonexistent;
|
||||
|
||||
# Verify cluster is intact
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
--error 1049
|
||||
CREATE TABLE nonexistent.t1 (s INT);
|
||||
|
||||
# Verify cluster is intact
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
--error 1050
|
||||
CREATE TABLE t1 (s INT);
|
||||
|
||||
# Verify cluster is intact
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
--error 1146
|
||||
ALTER TABLE nonexistent ADD COLUMN (c INT);
|
||||
|
||||
# Verify cluster is intact
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
DROP TABLE t1;
|
34
mysql-test/suite/galera/t/galera_vote_ddl.test
Normal file
34
mysql-test/suite/galera/t/galera_vote_ddl.test
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# Test voting on identical DDL errors (error messages should match)
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
#
|
||||
# 1. Ignore all DDL errors (avoids voting)
|
||||
#
|
||||
--connection node_1
|
||||
--let $wsrep_ignore_apply_errors_saved1 = `SELECT @@global.wsrep_ignore_apply_errors`
|
||||
SET @@global.wsrep_ignore_apply_errors = 7;
|
||||
--connection node_2
|
||||
--let $wsrep_ignore_apply_errors_saved2 = `SELECT @@global.wsrep_ignore_apply_errors`
|
||||
SET @@global.wsrep_ignore_apply_errors = 7;
|
||||
|
||||
--source galera_vote_ddl.inc
|
||||
|
||||
#
|
||||
# 2. Don't ignore any errors (forces voting)
|
||||
#
|
||||
--connection node_1
|
||||
SET @@global.wsrep_ignore_apply_errors = 0;
|
||||
--connection node_2
|
||||
SET @@global.wsrep_ignore_apply_errors = 0;
|
||||
|
||||
--source galera_vote_ddl.inc
|
||||
|
||||
--connection node_1
|
||||
--eval SET @@global.wsrep_ignore_apply_errors = $wsrep_ignore_apply_errors_saved1
|
||||
|
||||
--connection node_2
|
||||
--eval SET @@global.wsrep_ignore_apply_errors = $wsrep_ignore_apply_errors_saved2
|
Loading…
Reference in a new issue