diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-10-01 12:47:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-01 12:47:35 +0300 |
commit | 649451ae0d4c57aa524ab7ced18deb6f6621e466 (patch) | |
tree | 188fbca25a16d8789f47a73b46d8e55851417c0e /mysql-test | |
parent | 865237e5af9e07ceabaadd1ba4cf327eeba0bb4f (diff) | |
parent | c62e49d0cf90c1631e78ae3b10f2cb9383ac2d27 (diff) | |
download | mariadb-git-649451ae0d4c57aa524ab7ced18deb6f6621e466.tar.gz |
Merge pull request #875 from tempesta-tech/sysprg/MDEV-16656
MDEV-16656: DROP DATABASE crashes the Galera Cluster
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/galera/r/galera_drop_database.result | 17 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/galera_drop_database.test | 65 |
2 files changed, 82 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/r/galera_drop_database.result b/mysql-test/suite/galera/r/galera_drop_database.result new file mode 100644 index 00000000000..79789da5a11 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_drop_database.result @@ -0,0 +1,17 @@ +CREATE DATABASE fts; +USE fts; +CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; +CREATE TABLE fts_t2 (f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +INSERT INTO fts_t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; +INSERT INTO fts_t2 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; +DROP TABLE ten; +UPDATE fts_t1 SET f2 = 'abcd'; +UPDATE fts_t2 SET f2 = 'efjh'; +USE fts; +DROP TABLE fts_t1; +DROP TABLE fts_t2; +SHOW TABLES; +Tables_in_fts +DROP DATABASE fts; diff --git a/mysql-test/suite/galera/t/galera_drop_database.test b/mysql-test/suite/galera/t/galera_drop_database.test new file mode 100644 index 00000000000..47fe8315198 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_drop_database.test @@ -0,0 +1,65 @@ +# +# This test tests a DROP empty database +# +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +CREATE DATABASE fts; +USE fts; +CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; +CREATE TABLE fts_t2 (f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; + +# Insert 1K rows +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +INSERT INTO fts_t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; +INSERT INTO fts_t2 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; +DROP TABLE ten; +UPDATE fts_t1 SET f2 = 'abcd'; +UPDATE fts_t2 SET f2 = 'efjh'; + +--connection node_2 +let $wsrep_cluster_address = `SELECT @@global.wsrep_node_incoming_address`; +--source include/restart_mysqld.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--let $galera_connection_name = node_2a +--let $galera_server_number = 2 +--source include/galera_connect.inc +--connection node_2a +--source include/wait_until_ready.inc + +--connection node_1 +--let $restart_parameters = --wsrep-cluster-address=gcomm://$wsrep_cluster_address +--source include/restart_mysqld.inc + +--connection node_2a +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--let $galera_connection_name = node_1a +--let $galera_server_number = 1 +--source include/galera_connect.inc +--connection node_1a +--source include/wait_until_ready.inc + +USE fts; +DROP TABLE fts_t1; +DROP TABLE fts_t2; +SHOW TABLES; +DROP DATABASE fts; + +# Restore original auto_increment_offset values. +--let $node_1=node_1a +--let $node_2=node_2a +--source include/auto_increment_offset_restore.inc + +--source include/galera_end.inc |