mirror of
https://github.com/MariaDB/server.git
synced 2025-11-25 17:25:02 +03:00
If a mtr test runs multiple servers and only some of them get restarted on whatever reason with new command-line parameters, then subsequent mtr test may fail, because no cleanup is performed. Replication and Galera test suites are affected. In the mtr script, there is a server_need_restart function that decides whether we need to start a new mysqld process before the new (next) test. If the mysqld parameters were changed in the previous test - not necessarily the parameters of the primary mysqld server, maybe even the secondary server parameters - this function decides to start a new mysqld process. But since it does not remove the old (changed) parameters, the new process starts with the parameters changed by the *previous* test. To correct this error, we must delete the modified process parameters after checking that they have been changed during the previous test. This patch also simplifies and makes more stable the galera_drop_database test, during debugging of which this problem was detected. https://jira.mariadb.org/browse/MDEV-17421
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
#
|
|
# 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 test database with two sets of the FTS indexes:
|
|
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';
|
|
|
|
# Restart the second node:
|
|
--connection node_2
|
|
--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
|
|
|
|
--connection node_2
|
|
--source include/wait_until_ready.inc
|
|
|
|
# Drop the tables and database after nodes restarted:
|
|
--connection node_1
|
|
USE fts;
|
|
DROP TABLE fts_t1;
|
|
DROP TABLE fts_t2;
|
|
SHOW TABLES;
|
|
DROP DATABASE fts;
|
|
|
|
# Restore original auto_increment_offset values.
|
|
--source include/auto_increment_offset_restore.inc
|