summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2015-04-17 15:18:44 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2015-04-17 15:18:44 +0200
commit167332597f03f73057fbb4684687a013596181bd (patch)
tree1256610eb3a54a2e6f847badea452e3fc274a5c0 /mysql-test/suite
parent8125db1d9ae489162f08560f42c60c10a316afbc (diff)
parent702fdc52fa02c5f20004d169ad48494122d8ffed (diff)
downloadmariadb-git-167332597f03f73057fbb4684687a013596181bd.tar.gz
Merge 10.0 -> 10.1.
Conflicts: mysql-test/suite/multi_source/multisource.result sql/sql_base.cc
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result63
-rw-r--r--mysql-test/suite/innodb/r/innodb-fk.result75
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test75
-rw-r--r--mysql-test/suite/innodb/t/innodb-fk.test63
-rw-r--r--mysql-test/suite/multi_source/multisource.result87
-rw-r--r--mysql-test/suite/multi_source/multisource.test50
-rw-r--r--mysql-test/suite/perfschema/r/aggregate.result3
-rw-r--r--mysql-test/suite/perfschema/t/aggregate.test7
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel.result14
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel.test11
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result15
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf5
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test9
14 files changed, 308 insertions, 170 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result b/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result
deleted file mode 100644
index a357fe27f37..00000000000
--- a/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result
+++ /dev/null
@@ -1,63 +0,0 @@
-call mtr.add_suppression("InnoDB: Error: row_merge_drop_indexes_dict failed with error code*");
-create table t1(a int, b int) engine=innodb;
-create procedure innodb_insert_proc (repeat_count int)
-begin
-declare current_num int;
-set current_num = 0;
-while current_num < repeat_count do
-insert into t1 values(current_num, current_num);
-set current_num = current_num + 1;
-end while;
-end//
-commit;
-set autocommit=0;
-call innodb_insert_proc(20000);
-commit;
-set autocommit=1;
-create table t2(a int) engine=innodb;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28';
-alter table t1 add testcol int;
-ERROR HY000: The table 't1' is full
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t2 add testcol int;
-ERROR HY000: The table 't2' is full
-alter table t1 add testcol int;
-ERROR HY000: The table 't1' is full
-alter table t1 add testcol int;
-ERROR HY000: The table 't1' is full
-alter table t1 add testcol2 int;
-ERROR HY000: The table 't1' is full
-alter table t1 add testcol3 int;
-ERROR HY000: The table 't1' is full
-alter table t1 add testcol int;
-ERROR HY000: The table 't1' is full
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t2;
-alter table t1 add testcol2 int;
-ERROR HY000: The table 't1' is full
-alter table t1 add testcol3 int;
-ERROR HY000: The table 't1' is full
-call innodb_insert_proc(20000);
-set autocommit=0;
-call innodb_insert_proc(20000);
-commit;
-set autocommit=1;
-set DEBUG_DBUG='';
-drop procedure innodb_insert_proc;
-drop table t1;
-drop table if exists t2;
diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result
index 82ac412e339..956dbce58ed 100644
--- a/mysql-test/suite/innodb/r/innodb-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-fk.result
@@ -67,3 +67,78 @@ Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key c
Warning 1215 Cannot add foreign key constraint
drop table t2;
drop table t1;
+CREATE TABLE `#departaments` (
+`id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+CREATE TABLE `#departaments_tree` (
+`id_depart` INT(10) UNSIGNED NOT NULL,
+`id_depart_in` INT(10) UNSIGNED NOT NULL,
+PRIMARY KEY (`id_depart`,`id_depart_in`),
+CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+ALTER TABLE `#departaments_tree`
+ ADD FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments`(`id_depart`);
+SHOW CREATE TABLE `#departaments_tree`;
+Table Create Table
+#departaments_tree CREATE TABLE `#departaments_tree` (
+ `id_depart` int(10) unsigned NOT NULL,
+ `id_depart_in` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`id_depart`,`id_depart_in`),
+ KEY `id_depart_in` (`id_depart_in`),
+ CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`),
+ CONSTRAINT `#departaments_tree_ibfk_2` FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments` (`id_depart`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE `#departaments_tree`;
+DROP TABLE `#departaments`;
+CREATE TABLE `boroda` (
+`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+`a` INT(11) UNSIGNED DEFAULT NULL,
+`b` INT(11) UNSIGNED DEFAULT NULL,
+PRIMARY KEY (`id`),
+KEY `a` (`a`),
+CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+ALTER TABLE `boroda`
+ ADD FOREIGN KEY (`b`) REFERENCES `boroda`(`id`);
+ALTER TABLE `boroda` DROP FOREIGN KEY `boroda_ibfk_2`;
+RENAME TABLE `boroda` TO `#boroda`;
+ALTER TABLE `#boroda`
+ADD FOREIGN KEY (`b`) REFERENCES `#boroda`(`id`);
+SHOW CREATE TABLE `#boroda`;
+Table Create Table
+#boroda CREATE TABLE `#boroda` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `a` int(11) unsigned DEFAULT NULL,
+ `b` int(11) unsigned DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ KEY `b` (`b`),
+ CONSTRAINT `#boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `#boroda` (`id`),
+ CONSTRAINT `#boroda_ibfk_2` FOREIGN KEY (`b`) REFERENCES `#boroda` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE `#boroda`;
+CREATE TABLE `boroda` (
+`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+`a` INT(11) UNSIGNED DEFAULT NULL,
+`b` INT(11) UNSIGNED DEFAULT NULL,
+PRIMARY KEY (`id`),
+KEY `a` (`a`),
+CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+RENAME TABLE `boroda` TO `bor#oda`;
+ALTER TABLE `bor#oda`
+ADD FOREIGN KEY (`b`) REFERENCES `bor#oda`(`id`);
+SHOW CREATE TABLE `bor#oda`;
+Table Create Table
+bor#oda CREATE TABLE `bor#oda` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `a` int(11) unsigned DEFAULT NULL,
+ `b` int(11) unsigned DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ KEY `b` (`b`),
+ CONSTRAINT `bor#oda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `bor#oda` (`id`),
+ CONSTRAINT `bor#oda_ibfk_2` FOREIGN KEY (`b`) REFERENCES `bor#oda` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE `bor#oda`;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt
deleted file mode 100644
index 9c2ee7846b6..00000000000
--- a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-use-native-aio=0
diff --git a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
deleted file mode 100644
index 8fd8e3914c4..00000000000
--- a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test
+++ /dev/null
@@ -1,75 +0,0 @@
-# MDEV-6288: Innodb causes server crash after disk full, then can't ALTER TABLE any more
---source include/have_innodb.inc
---source include/not_windows.inc
---source include/not_valgrind.inc
---source include/not_embedded.inc
-
-# DEBUG_SYNC must be compiled in.
---source include/have_debug_sync.inc
-
-call mtr.add_suppression("InnoDB: Error: row_merge_drop_indexes_dict failed with error code*");
-
-create table t1(a int, b int) engine=innodb;
-
-delimiter //;
-create procedure innodb_insert_proc (repeat_count int)
-begin
- declare current_num int;
- set current_num = 0;
- while current_num < repeat_count do
- insert into t1 values(current_num, current_num);
- set current_num = current_num + 1;
- end while;
-end//
-delimiter ;//
-commit;
-
-set autocommit=0;
-call innodb_insert_proc(20000);
-commit;
-set autocommit=1;
-
-create table t2(a int) engine=innodb;
-show create table t2;
-
-# This caused crash earlier
-set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28';
---error 1114
-alter table t1 add testcol int;
-show create table t1;
---error 1114
-alter table t2 add testcol int;
---error 1114
-alter table t1 add testcol int;
---error 1114
-alter table t1 add testcol int;
---error 1114
-alter table t1 add testcol2 int;
---error 1114
-alter table t1 add testcol3 int;
---error 1114
-alter table t1 add testcol int;
-show create table t1;
---error 0,1051
-drop table t2;
---error 1114
-alter table t1 add testcol2 int;
---error 1114
-alter table t1 add testcol3 int;
---error 0,1114
-call innodb_insert_proc(20000);
-set autocommit=0;
---error 0,1114
-call innodb_insert_proc(20000);
-commit;
-set autocommit=1;
-
-set DEBUG_DBUG='';
-
-drop procedure innodb_insert_proc;
-drop table t1;
---disable_warnings
-drop table if exists t2;
---enable_warnings
-
-
diff --git a/mysql-test/suite/innodb/t/innodb-fk.test b/mysql-test/suite/innodb/t/innodb-fk.test
index 2c2a8c76cf8..f7bcbe238dd 100644
--- a/mysql-test/suite/innodb/t/innodb-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-fk.test
@@ -124,3 +124,66 @@ show warnings;
drop table t2;
drop table t1;
+
+#
+# MDEV-7627: Some symbols in table name can cause to Error Code: 1050 when created FK
+#
+
+CREATE TABLE `#departaments` (
+ `id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `#departaments_tree` (
+ `id_depart` INT(10) UNSIGNED NOT NULL,
+ `id_depart_in` INT(10) UNSIGNED NOT NULL,
+ PRIMARY KEY (`id_depart`,`id_depart_in`),
+ CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `#departaments_tree`
+ ADD FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments`(`id_depart`);
+
+SHOW CREATE TABLE `#departaments_tree`;
+
+DROP TABLE `#departaments_tree`;
+DROP TABLE `#departaments`;
+
+CREATE TABLE `boroda` (
+ `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `a` INT(11) UNSIGNED DEFAULT NULL,
+ `b` INT(11) UNSIGNED DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `boroda`
+ ADD FOREIGN KEY (`b`) REFERENCES `boroda`(`id`);
+
+ALTER TABLE `boroda` DROP FOREIGN KEY `boroda_ibfk_2`;
+
+RENAME TABLE `boroda` TO `#boroda`;
+
+ALTER TABLE `#boroda`
+ADD FOREIGN KEY (`b`) REFERENCES `#boroda`(`id`);
+
+SHOW CREATE TABLE `#boroda`;
+DROP TABLE `#boroda`;
+
+CREATE TABLE `boroda` (
+ `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `a` INT(11) UNSIGNED DEFAULT NULL,
+ `b` INT(11) UNSIGNED DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `a` (`a`),
+ CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+RENAME TABLE `boroda` TO `bor#oda`;
+
+ALTER TABLE `bor#oda`
+ADD FOREIGN KEY (`b`) REFERENCES `bor#oda`(`id`);
+
+SHOW CREATE TABLE `bor#oda`;
+DROP TABLE `bor#oda`;
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index 4475ec58c6f..d9689f759bf 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -9,15 +9,36 @@ master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
-show slave 'master1' status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
-Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No conservative
-show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
-Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No conservative
-show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
+#
+# Checking SHOW SLAVE 'master1' STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW SLAVE STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+#
drop database if exists db1;
create database db1;
use db1;
@@ -74,10 +95,26 @@ master_host='127.0.0.1',
master_user='root';
start slave;
include/wait_for_slave_to_start.inc
-show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin.000002 601 master-bin.000001 Yes Yes 0 0 313 899 None 0 No 0 No 0 0 2 No conservative 0 1073741824 7 0 60.000 0-1-4
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 988 mysqld-relay-bin-master1.000002 1276 master-bin.000001 Yes Yes 0 0 988 1582 None 0 No 0 No 0 0 1 No conservative 0 1073741824 17 0 60.000 0-1-4
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
insert into t1 (f1) values ('three');
drop database if exists db2;
create database db2;
@@ -104,10 +141,26 @@ Log_name File_size
master-bin.000002 367
insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB;
-show all slaves status;
-Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 921 mysqld-relay-bin.000002 1209 master-bin.000001 Yes Yes 0 0 921 1507 None 0 No 0 No 0 0 2 No conservative 0 1073741824 17 0 60.000 0-1-7
-master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000002 740 mysqld-relay-bin-master1.000004 1028 master-bin.000002 Yes Yes 0 0 740 1378 None 0 No 0 No 0 0 1 No conservative 0 1073741824 37 0 60.000 0-1-7
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
select * from db1.t1;
i f1
1 one
diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test
index 754dc9fa650..c99db802981 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -49,12 +49,28 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1
-show slave 'master1' status;
---replace_result $SERVER_MYPORT_1 MYPORT_1
-show slave status;
---replace_result $SERVER_MYPORT_1 MYPORT_1
-show all slaves status;
+--echo #
+--echo # Checking SHOW SLAVE 'master1' STATUS
+--echo #
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--source include/show_slave_status.inc
+--let $slave_name=
+
+--echo #
+--echo # Checking SHOW SLAVE STATUS
+--echo #
+--source include/show_slave_status.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
# Check that replication actually works
@@ -144,8 +160,15 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
-show all slaves status;
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
# Check that replication from two servers actually works
@@ -214,8 +237,15 @@ let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
-show all slaves status;
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
--sorted_result
select * from db1.t1;
diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result
index ab927f544cf..c8fa1cc2b24 100644
--- a/mysql-test/suite/perfschema/r/aggregate.result
+++ b/mysql-test/suite/perfschema/r/aggregate.result
@@ -1,4 +1,6 @@
"General cleanup"
+set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval;
+set @@global.aria_checkpoint_interval= 0;
drop table if exists t1;
update performance_schema.setup_instruments set enabled = 'NO';
update performance_schema.setup_consumers set enabled = 'NO';
@@ -116,3 +118,4 @@ update performance_schema.setup_consumers set enabled = 'YES';
update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
+set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save;
diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test
index 672737ae2a7..fe30a7b8697 100644
--- a/mysql-test/suite/perfschema/t/aggregate.test
+++ b/mysql-test/suite/perfschema/t/aggregate.test
@@ -6,6 +6,10 @@
--echo "General cleanup"
+# MDEV-7187 - test fails sporadically in buildbot
+set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval;
+set @@global.aria_checkpoint_interval= 0;
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -188,3 +192,6 @@ update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
+
+set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save;
+
diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result
index e0bbb8434f5..7845222998f 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result
@@ -5,8 +5,22 @@ SET GLOBAL slave_parallel_threads=10;
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*)))
+OK
+include/stop_slave.inc
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*)))
+OK
*** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test
index 8a78d42ab96..93ee3bfa8b6 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test
@@ -11,9 +11,20 @@ SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=10;
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
+
+# Check that we do not spawn any worker threads when no slave is running.
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
CHANGE MASTER TO master_use_gtid=slave_pos;
--source include/start_slave.inc
+# Check that worker threads get spawned when slave starts.
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+# ... and that worker threads get removed when slave stops.
+--source include/stop_slave.inc
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+--source include/start_slave.inc
+SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
--echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
index 2956d04c065..56aa5976f91 100644
--- a/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
@@ -1,13 +1,22 @@
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
-SELECT @@GLOBAL.slave_parallel_threads as 'must be zero because of default';
-must be zero because of default
-0
+SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
+must be 20 because of .cnf
+20
SELECT @@SESSION.slave_parallel_threads as 'no session var';
ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable
SET GLOBAL slave_parallel_threads= 0;
SET GLOBAL slave_parallel_threads= DEFAULT;
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
+must be 0 because of default
+0
SET GLOBAL slave_parallel_threads= 10;
SELECT @@GLOBAL.slave_parallel_threads;
@@GLOBAL.slave_parallel_threads
10
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
new file mode 100644
index 00000000000..02bdb44e1de
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
@@ -0,0 +1,5 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+slave_parallel_threads=20
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
index 8e987489d86..b567b7f8854 100644
--- a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
@@ -2,13 +2,20 @@
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
-SELECT @@GLOBAL.slave_parallel_threads as 'must be zero because of default';
+# Check that we don't spawn worker threads at server startup, when no
+# slave is configured (MDEV-5289).
+SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.slave_parallel_threads as 'no session var';
SET GLOBAL slave_parallel_threads= 0;
SET GLOBAL slave_parallel_threads= DEFAULT;
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
SET GLOBAL slave_parallel_threads= 10;
SELECT @@GLOBAL.slave_parallel_threads;
+# Check that we don't spawn worker threads when no slave is started.
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;