summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-09-07 20:24:49 +0200
committerSergei Golubchik <serg@mariadb.org>2018-09-07 20:24:49 +0200
commit908ac40bdb9ab09cb718786f33bed417161a1748 (patch)
treef6f85e3f700212f636141bc6bc871b1acadcf12d /mysql-test
parentedb3a32c6cc06407efc96a30a6c7948fb9628ace (diff)
parent0254be96f76c7be75e0650342a826c3d66fade52 (diff)
downloadmariadb-git-908ac40bdb9ab09cb718786f33bed417161a1748.tar.gz
Merge branch 'bb-10.1-release' into 10.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_foreign_key.test60
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/r/gis.result16
-rw-r--r--mysql-test/r/group_min_max.result28
-rw-r--r--mysql-test/r/join.result6
-rw-r--r--mysql-test/r/selectivity.result48
-rw-r--r--mysql-test/r/selectivity_innodb.result48
-rw-r--r--mysql-test/r/sp.result17
-rw-r--r--mysql-test/r/stat_tables.result13
-rw-r--r--mysql-test/r/stat_tables_innodb.result13
-rw-r--r--mysql-test/suite/galera/r/galera#505.result5
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff103
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#332.result111
-rw-r--r--mysql-test/suite/galera/t/galera#505.test32
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#332.test113
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_pc_weight.result31
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_pc_weight.test55
-rw-r--r--mysql-test/suite/innodb/r/foreign-keys.result73
-rw-r--r--mysql-test/suite/innodb/r/foreign_key.result19
-rw-r--r--mysql-test/suite/innodb/t/foreign-keys.test87
-rw-r--r--mysql-test/suite/innodb/t/foreign_key.test25
-rw-r--r--mysql-test/suite/maria/create.result33
-rw-r--r--mysql-test/suite/maria/create.test42
-rw-r--r--mysql-test/suite/maria/maria.result4
-rw-r--r--mysql-test/suite/maria/maria.test10
-rw-r--r--mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result3
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test62
-rw-r--r--mysql-test/t/gis.test15
-rw-r--r--mysql-test/t/group_min_max.test17
-rw-r--r--mysql-test/t/join.test3
-rw-r--r--mysql-test/t/selectivity.test36
-rw-r--r--mysql-test/t/sp.test21
-rw-r--r--mysql-test/t/stat_tables.test12
-rw-r--r--mysql-test/unstable-tests118
34 files changed, 1097 insertions, 184 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
deleted file mode 100644
index d10deece1b1..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_foreign_key.test
+++ /dev/null
@@ -1,60 +0,0 @@
-# Check the replication of the FOREIGN_KEY_CHECKS variable.
-
--- source include/master-slave.inc
-
-eval CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=$engine_type;
-eval CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=$engine_type;
-
-SET FOREIGN_KEY_CHECKS=0;
-INSERT INTO t1 VALUES (10);
-INSERT INTO t1 VALUES (NULL),(NULL),(NULL);
-INSERT INTO t2 VALUES (5,0);
-INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID());
-SET FOREIGN_KEY_CHECKS=1;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY b;
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY b;
-
-connection master;
-SET TIMESTAMP=1000000000;
-CREATE TABLE t3 ( a INT UNIQUE );
-SET FOREIGN_KEY_CHECKS=0;
---error ER_DUP_ENTRY
-INSERT INTO t3 VALUES (1),(1);
-sync_slave_with_master;
-
-connection master;
-SET FOREIGN_KEY_CHECKS=0;
-DROP TABLE IF EXISTS t1,t2,t3;
-SET FOREIGN_KEY_CHECKS=1;
-sync_slave_with_master;
-
-#
-# Bug #32468 delete rows event on a table with foreign key constraint fails
-#
-
-connection master;
-
-eval create table t1 (b int primary key) engine = $engine_type;
-eval create table t2 (a int primary key, b int, foreign key (b) references t1(b))
- engine = $engine_type;
-
-insert into t1 set b=1;
-insert into t2 set a=1, b=1;
-
-set foreign_key_checks=0;
-delete from t1;
-
---echo must sync w/o a problem (could not with the buggy code)
-sync_slave_with_master;
-select count(*) from t1 /* must be zero */;
-
-
-# cleanup for bug#32468
-
-connection master;
-drop table t2,t1;
-
---source include/rpl_end.inc
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 0d84e5dbbbc..d969d7bf9f6 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1447,7 +1447,7 @@ sub command_line_setup {
foreach my $fs (@tmpfs_locations)
{
- if ( -d $fs && ! -l $fs )
+ if ( -d $fs && ! -l $fs && -w $fs )
{
my $template= "var_${opt_build_thread}_XXXX";
$opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0);
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 76f4f6accdb..f89cceb3664 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1733,6 +1733,22 @@ c2
DROP TABLE t1;
SET optimizer_switch=@save_optimizer_switch;
#
+# MDEV-16995: ER_CANT_CREATE_GEOMETRY_OBJECT encountered for a query with
+# optimizer_use_condition_selectivity>=3
+#
+CREATE TABLE t1 (a POINT);
+INSERT INTO t1 VALUES (POINT(1,1)),(POINT(1,2)),(POINT(1,3));
+set @save_use_stat_tables= @@use_stat_tables;
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set @@use_stat_tables= PREFERABLY;
+set @@optimizer_use_condition_selectivity=3;
+SELECT COUNT(*) FROM t1 WHERE a IN ('test','test1');
+COUNT(*)
+0
+set @@use_stat_tables= @save_use_stat_tables;
+set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1;
+#
# End 10.0 tests
#
SHOW CREATE TABLE information_schema.geometry_columns;
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index ec3f4d9bf99..777780f8400 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -3733,6 +3733,34 @@ id MIN(a) MAX(a)
4 2001-01-04 2001-01-04
DROP TABLE t1;
#
+# MDEV-17039: Query plan changes when we use GROUP BY optimization with optimizer_use_condition_selectivity=4
+# and use_stat_tables= PREFERABLY
+#
+CREATE TABLE t1 (a INT, b INT,c INT DEFAULT 0, INDEX (a,b));
+INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5),
+(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set @save_use_stat_tables= @@use_stat_tables;
+set @@optimizer_use_condition_selectivity=4;
+set @@use_stat_tables=PREFERABLY;
+explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00
+1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index
+2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by
+Warnings:
+Note 1003 select `test`.`t1_outer`.`a` AS `a` from <materialize> (select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where (`test`.`t1_outer`.`a` = `<subquery2>`.`max(b)`)
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+set @@use_stat_tables=@save_use_stat_tables;
+explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00
+1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index
+2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by
+Warnings:
+Note 1003 select `test`.`t1_outer`.`a` AS `a` from <materialize> (select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where (`test`.`t1_outer`.`a` = `<subquery2>`.`max(b)`)
+drop table t1;
+#
# End of 10.0 tests
#
#
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 65886e54485..8c529b27e92 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -1519,11 +1519,13 @@ ERROR 42S22: Unknown column 'f' in 'from clause'
DROP TABLE t;
CREATE TABLE t (f INT);
CALL p;
-ERROR 42S22: Unknown column 'f' in 'from clause'
+f
DROP TABLE t;
CREATE TABLE t (i INT);
CALL p;
-ERROR 42S22: Unknown column 'f' in 'from clause'
+ERROR 42S22: Unknown column 't1.f' in 'field list'
+CALL p;
+ERROR 42S22: Unknown column 't1.f' in 'field list'
DROP PROCEDURE p;
DROP TABLE t;
CREATE TABLE t1 (a INT, b INT);
diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result
index 6cb7934678b..2e69f674ea3 100644
--- a/mysql-test/r/selectivity.result
+++ b/mysql-test/r/selectivity.result
@@ -782,9 +782,9 @@ set optimizer_use_condition_selectivity=3;
explain extended
select * from t1 where a < 1 and a > 7;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` < 1) and (`test`.`t1`.`a` > 7))
select * from t1 where a < 1 and a > 7;
a
drop table t1;
@@ -1506,9 +1506,9 @@ col1
explain extended
select * from t2 where col1 < 'b' and col1 > 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
-Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where 0
+Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where ((`test`.`t2`.`col1` < 'b') and (`test`.`t2`.`col1` > 'd'))
drop table t1,t2;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
@@ -1595,3 +1595,43 @@ drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
+#
+# MDEV-15306: Wrong/Unexpected result with the value
+# optimizer_use_condition_selectivity set to 4
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+SET @cnt := @cnt + 1;
+RETURN 1;
+END;|
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @save_use_stat_tables= @@use_stat_tables;
+set @@use_stat_tables='complementary';
+set @@optimizer_use_condition_selectivity=4;
+SET @cnt= 0;
+SELECT * FROM t1 WHERE a = f1();
+a
+1
+SELECT @cnt;
+@cnt
+1
+set @@use_stat_tables='preferably';
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+SET @cnt := 0;
+set @@optimizer_use_condition_selectivity=4;
+SELECT * FROM t1 WHERE a = f1();
+a
+1
+SELECT @cnt;
+@cnt
+2
+alter table t1 force;
+set @@use_stat_tables= @save_use_stat_tables;
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+drop table t1;
+drop function f1;
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result
index e0227163d69..d3e71088f87 100644
--- a/mysql-test/r/selectivity_innodb.result
+++ b/mysql-test/r/selectivity_innodb.result
@@ -789,9 +789,9 @@ set optimizer_use_condition_selectivity=3;
explain extended
select * from t1 where a < 1 and a > 7;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` < 1) and (`test`.`t1`.`a` > 7))
select * from t1 where a < 1 and a > 7;
a
drop table t1;
@@ -1516,9 +1516,9 @@ col1
explain extended
select * from t2 where col1 < 'b' and col1 > 'd';
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
-Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where 0
+Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where ((`test`.`t2`.`col1` < 'b') and (`test`.`t2`.`col1` > 'd'))
drop table t1,t2;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
@@ -1605,6 +1605,46 @@ drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
+#
+# MDEV-15306: Wrong/Unexpected result with the value
+# optimizer_use_condition_selectivity set to 4
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+SET @cnt := @cnt + 1;
+RETURN 1;
+END;|
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @save_use_stat_tables= @@use_stat_tables;
+set @@use_stat_tables='complementary';
+set @@optimizer_use_condition_selectivity=4;
+SET @cnt= 0;
+SELECT * FROM t1 WHERE a = f1();
+a
+1
+SELECT @cnt;
+@cnt
+1
+set @@use_stat_tables='preferably';
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+SET @cnt := 0;
+set @@optimizer_use_condition_selectivity=4;
+SELECT * FROM t1 WHERE a = f1();
+a
+1
+SELECT @cnt;
+@cnt
+2
+alter table t1 force;
+set @@use_stat_tables= @save_use_stat_tables;
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+drop table t1;
+drop function f1;
set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
set @tmp_ust= @@use_stat_tables;
set @tmp_oucs= @@optimizer_use_condition_selectivity;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index bc33c08d9d8..044d430221a 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -7901,6 +7901,23 @@ SET S.CLOSE_YN = ''
where 1=1;
drop function if exists f1;
drop table t1,t2;
+#
+# MDEV-16957: Server crashes in Field_iterator_natural_join::next
+# upon 2nd execution of SP
+#
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c);
+CALL sp;
+ERROR 42S22: Unknown column 'c' in 'from clause'
+CALL sp;
+ERROR 42S22: Unknown column 'c' in 'from clause'
+CALL sp;
+ERROR 42S22: Unknown column 'c' in 'from clause'
+alter table t1 add column c int;
+CALL sp;
+c a b a b
+DROP PROCEDURE sp;
+DROP TABLE t1;
# End of 5.5 test
#
# MDEV-7040: Crash in field_conv, memcpy_field_possible, part#2
diff --git a/mysql-test/r/stat_tables.result b/mysql-test/r/stat_tables.result
index ceadb61feea..224c734118b 100644
--- a/mysql-test/r/stat_tables.result
+++ b/mysql-test/r/stat_tables.result
@@ -578,6 +578,19 @@ db_name table_name column_name min_value max_value nulls_ratio avg_length avg_fr
DROP TABLE t1;
set use_stat_tables=@save_use_stat_tables;
#
+# MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
+#
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @@optimizer_use_condition_selectivity=4;
+set @@use_stat_tables= PREFERABLY;
+explain
+SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL
+1 SIMPLE user ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+set use_stat_tables=@save_use_stat_tables;
+#
# MDEV-16757: manual addition of min/max statistics for BLOB
#
SET use_stat_tables= PREFERABLY;
diff --git a/mysql-test/r/stat_tables_innodb.result b/mysql-test/r/stat_tables_innodb.result
index c5e7309861c..ba1dee3106d 100644
--- a/mysql-test/r/stat_tables_innodb.result
+++ b/mysql-test/r/stat_tables_innodb.result
@@ -605,6 +605,19 @@ db_name table_name column_name min_value max_value nulls_ratio avg_length avg_fr
DROP TABLE t1;
set use_stat_tables=@save_use_stat_tables;
#
+# MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
+#
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @@optimizer_use_condition_selectivity=4;
+set @@use_stat_tables= PREFERABLY;
+explain
+SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL
+1 SIMPLE user ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+set use_stat_tables=@save_use_stat_tables;
+#
# MDEV-16757: manual addition of min/max statistics for BLOB
#
SET use_stat_tables= PREFERABLY;
diff --git a/mysql-test/suite/galera/r/galera#505.result b/mysql-test/suite/galera/r/galera#505.result
new file mode 100644
index 00000000000..9ae09cac187
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera#505.result
@@ -0,0 +1,5 @@
+SET GLOBAL wsrep_provider_options = 'pc.weight=3';
+SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options';
+Variable_name Value
+wsrep_provider_options pc.weight = 3
+SET GLOBAL wsrep_provider_options = 'pc.weight=1';
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
new file mode 100644
index 00000000000..2803211c418
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
@@ -0,0 +1,103 @@
+--- mysql-test/suite/galera/r/galera_sst_rsync2.result 2018-09-07 01:29:47.133578834 +0200
++++ galera_sst_rsync2.result 2018-09-07 01:29:37.619557422 +0200
+@@ -260,3 +260,100 @@
+ DROP TABLE t1;
+ COMMIT;
+ SET AUTOCOMMIT=ON;
++Performing State Transfer on a server that has been killed and restarted
++while a DDL was in progress on it
++CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++INSERT INTO t1 VALUES ('node1_committed_before');
++START TRANSACTION;
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++INSERT INTO t1 VALUES ('node2_committed_before');
++COMMIT;
++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++SET wsrep_sync_wait = 0;
++Killing server ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++INSERT INTO t1 (f1) VALUES ('node1_committed_during');
++COMMIT;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++Performing --wsrep-recover ...
++Starting server ...
++Using --wsrep-start-position when starting mysqld ...
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++INSERT INTO t1 (f1) VALUES ('node2_committed_after');
++COMMIT;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++COMMIT;
++SET AUTOCOMMIT=OFF;
++START TRANSACTION;
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++INSERT INTO t1 (f1) VALUES ('node1_committed_after');
++COMMIT;
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++ROLLBACK;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++COMMIT;
++SET AUTOCOMMIT=ON;
++SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
++COUNT(*) = 2
++1
++SELECT COUNT(*) = 35 FROM t1;
++COUNT(*) = 35
++1
++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
++COUNT(*) = 0
++1
++DROP TABLE t1;
++COMMIT;
++SET AUTOCOMMIT=ON;
++SET GLOBAL debug_dbug = $debug_orig;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#332.result b/mysql-test/suite/galera/r/mysql-wsrep#332.result
new file mode 100644
index 00000000000..8667f5e9c41
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#332.result
@@ -0,0 +1,111 @@
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER) ENGINE=INNODB;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1);
+INSERT INTO c VALUES (2, 2);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f1 = f1 + 100;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+ALTER TABLE c ADD FOREIGN KEY (p_id) REFERENCES p(f1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id
+1 1
+2 2
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p1 SET f1 = f1 + 100;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p1;
+f1 f2
+1 0
+2 0
+SELECT * FROM p2;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id1 p_id2
+1 1 1
+2 2 2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p2 SET f1 = f1 + 100;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p1;
+f1 f2
+1 0
+2 0
+SELECT * FROM p2;
+f1 f2
+1 0
+2 0
+SELECT * FROM c;
+f1 p_id1 p_id2
+1 1 1
+2 2 2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
diff --git a/mysql-test/suite/galera/t/galera#505.test b/mysql-test/suite/galera/t/galera#505.test
new file mode 100644
index 00000000000..78cdf53db74
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera#505.test
@@ -0,0 +1,32 @@
+# galera#505 - Change of pc.weight wsrep param will be correctly stored in wsrep_provider_options variable
+
+--source include/galera_cluster.inc
+
+--disable_query_log
+select CAST(REGEXP_REPLACE(variable_value,'^(\\d+)\\.(\\d+)\\.(\\d+)(r\\d+)','\\3') AS UNSIGNED) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version' INTO @GALERA_VERSION;
+
+# Make sure that the test is operating on the right version of galera library.
+--let $galera_version=24
+eval SET @REQUIRED_GALERA_VERSION='$galera_version';
+
+SELECT @GALERA_VERSION, @REQUIRED_GALERA_VERSION;
+
+if (!`SELECT (@GALERA_VERSION < @REQUIRED_GALERA_VERSION)`)
+{
+ skip Test requires Galera library version 25.3.$galera_version;
+}
+--enable_query_log
+
+--connection node_1
+
+# Convert "... pc.weight = N; ..." to "N; ..."
+--let $s1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('pc.weight =', @@wsrep_provider_options) + LENGTH('pc.weight = '))`
+# Convert "N; ..." to "N"
+--let $pc_weight_value = `SELECT SUBSTR('$s1', 1, LOCATE(';', '$s1') - 1)`
+
+SET GLOBAL wsrep_provider_options = 'pc.weight=3';
+
+-- replace_regex /.*(pc\.weight = [0-9]+);.*/\1/
+SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options';
+
+--eval SET GLOBAL wsrep_provider_options = 'pc.weight=$pc_weight_value'
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#332.test b/mysql-test/suite/galera/t/mysql-wsrep#332.test
new file mode 100644
index 00000000000..2da01ba900e
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#332.test
@@ -0,0 +1,113 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+# Open connection node_1a here, MW-369.inc will use it later
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+#
+# Test the scenario where a foreign key is added to an existing child table, and
+# concurrently UPDATE the parent table so that it violates the constraint.
+#
+# We expect that ALTER TABLE ADD FOREIGN KEY adds a table level key on both
+# parent and child table. And therefore we also expect the UPDATE to fail
+# certification.
+#
+--connection node_1
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER) ENGINE=INNODB;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1);
+INSERT INTO c VALUES (2, 2);
+
+--let $mw_369_parent_query = UPDATE p SET f1 = f1 + 100
+--let $mw_369_child_query = ALTER TABLE c ADD FOREIGN KEY (p_id) REFERENCES p(f1)
+
+--source MW-369.inc
+
+# Expect certification failure
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+
+#
+# Same as above, except that two foreign keys pointing to different parent
+# tables are added, p1 and p2. Concurrently UPDATE p1.
+#
+# Expect certification error on UPDATE.
+#
+--connection node_1
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+
+--let $mw_369_parent_query = UPDATE p1 SET f1 = f1 + 100
+--let $mw_369_child_query = ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1)
+
+--source MW-369.inc
+
+# Expect certification failure
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+
+
+#
+# Same as above, except that UPDATE is on p2.
+#
+--connection node_1
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id1 INTEGER, p_id2 INTEGER) ENGINE=INNODB;
+
+INSERT INTO p1 VALUES (1, 0), (2, 0);
+INSERT INTO p2 VALUES (1, 0), (2, 0);
+
+INSERT INTO c VALUES (1, 1, 1);
+INSERT INTO c VALUES (2, 2, 2);
+
+--let $mw_369_parent_query = UPDATE p2 SET f1 = f1 + 100
+--let $mw_369_child_query = ALTER TABLE c ADD FOREIGN KEY (p_id1) REFERENCES p1(f1), ADD FOREIGN KEY (p_id2) REFERENCES p2(f1)
+
+--source MW-369.inc
+
+# Expect certification failure
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
diff --git a/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
index 6fb931638ef..9f845ffe776 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
@@ -1,11 +1,17 @@
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
-Suspending node ...
+SELECT VARIABLE_VALUE = 5 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 5
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
SET SESSION wsrep_sync_wait=0;
SET SESSION wsrep_on=OFF;
SET SESSION wsrep_on=ON;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 2
+SHOW STATUS LIKE 'wsrep_cluster_weight';
+Variable_name Value
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
@@ -22,9 +28,13 @@ SHOW STATUS LIKE 'wsrep_local_state_comment';
Variable_name Value
wsrep_local_state_comment Initialized
SET SESSION wsrep_sync_wait=0;
+SET SESSION wsrep_on=OFF;
+SET SESSION wsrep_on=ON;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 2
+SHOW STATUS LIKE 'wsrep_cluster_weight';
+Variable_name Value
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
@@ -40,7 +50,8 @@ wsrep_local_state 0
SHOW STATUS LIKE 'wsrep_local_state_comment';
Variable_name Value
wsrep_local_state_comment Initialized
-Resuming node ...
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
@@ -57,11 +68,14 @@ SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VAR
VARIABLE_VALUE = 'Synced'
1
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
-SET SESSION wsrep_sync_wait=0;
-SET SESSION wsrep_sync_wait=0;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 3
1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
@@ -80,6 +94,8 @@ VARIABLE_VALUE = 'Synced'
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 3
1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
@@ -98,6 +114,8 @@ VARIABLE_VALUE = 'Synced'
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 3
1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+VARIABLE_VALUE = 3
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
@@ -116,6 +134,9 @@ VARIABLE_VALUE = 'Synced'
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
CALL mtr.add_suppression('overriding reported weight for');
+CALL mtr.add_suppression('SYNC message from member');
+CALL mtr.add_suppression('user message in state LEAVING');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
CALL mtr.add_suppression('WSREP: user message in state LEAVING');
-CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
CALL mtr.add_suppression('overriding reported weight for');
diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
index d69881aa5eb..0a94e7cd85d 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
@@ -8,9 +8,12 @@
--source include/have_innodb.inc
--connection node_1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
---source include/galera_suspend.inc
---sleep 10
+SELECT VARIABLE_VALUE = 5 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
+
+# Isolate node_1 from the cluster.
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
--connection node_2
# Do not wait for causality as we are no longer in the primary component
@@ -22,8 +25,9 @@ SET SESSION wsrep_on=ON;
# We can not use SELECT queries here, as only SHOW is allowed to run.
# For nodes #2 and #3, we expect a non-primary component of size 2
-
+# and cluster weight 0
SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_weight';
SHOW STATUS LIKE 'wsrep_cluster_status';
SHOW STATUS LIKE 'wsrep_connected';
SHOW STATUS LIKE 'wsrep_ready';
@@ -35,8 +39,13 @@ SHOW STATUS LIKE 'wsrep_local_state_comment';
--source include/galera_connect.inc
--connection node_3
SET SESSION wsrep_sync_wait=0;
+SET SESSION wsrep_on=OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
+--source include/wait_condition.inc
+SET SESSION wsrep_on=ON;
SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW STATUS LIKE 'wsrep_cluster_weight';
SHOW STATUS LIKE 'wsrep_cluster_status';
SHOW STATUS LIKE 'wsrep_connected';
SHOW STATUS LIKE 'wsrep_ready';
@@ -44,15 +53,13 @@ SHOW STATUS LIKE 'wsrep_local_state';
SHOW STATUS LIKE 'wsrep_local_state_comment';
--connection node_1
---source include/galera_resume.inc
---sleep 10
---source include/wait_until_connected_again.inc
# For Node #1, we expect a primary component of size 1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
@@ -60,30 +67,27 @@ SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
-# Restore the cluster by resetting wsrep_cluster_address on nodes #1 and #2
+# Resume cluster connectivity on node_1
+--connection node_1
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
---connection node_2
---disable_query_log
---eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
---enable_query_log
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
-SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
+--connection node_2
+--source include/wait_condition.inc
--connection node_3
---disable_query_log
---eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
---enable_query_log
-
-SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
-
-# On all nodes, we now expect a Primary component of size 3, Synced and ready
+--source include/wait_condition.inc
--connection node_1
---source include/wait_until_connected_again.inc
+--source include/wait_condition.inc
+
+# On all nodes, we now expect a Primary component of size 3, weight 3, Synced and ready
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
@@ -92,6 +96,7 @@ SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VAR
--connection node_2
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
@@ -100,6 +105,7 @@ SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VAR
--connection node_3
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_weight';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
@@ -116,8 +122,11 @@ CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
--connection node_2
CALL mtr.add_suppression('overriding reported weight for');
+CALL mtr.add_suppression('SYNC message from member');
+CALL mtr.add_suppression('user message in state LEAVING');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
--connection node_3
CALL mtr.add_suppression('WSREP: user message in state LEAVING');
-CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
CALL mtr.add_suppression('overriding reported weight for');
diff --git a/mysql-test/suite/innodb/r/foreign-keys.result b/mysql-test/suite/innodb/r/foreign-keys.result
index 53ddf618244..66fc00e34d0 100644
--- a/mysql-test/suite/innodb/r/foreign-keys.result
+++ b/mysql-test/suite/innodb/r/foreign-keys.result
@@ -14,3 +14,76 @@ ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people`
ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people`
(`people_id`);
drop table title, department, people;
+create table t1 (a int primary key, b int) engine=innodb;
+create table t2 (c int primary key, d int,
+foreign key (d) references t1 (a) on update cascade) engine=innodb;
+insert t1 values (1,1),(2,2),(3,3);
+insert t2 values (4,1),(5,2),(6,3);
+flush table t2 with read lock;
+connect con1,localhost,root;
+delete from t1 where a=2;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE)
+update t1 set a=10 where a=1;
+connection default;
+unlock tables;
+connection con1;
+connection default;
+lock table t2 write;
+connection con1;
+delete from t1 where a=2;
+connection default;
+unlock tables;
+connection con1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE)
+connection default;
+unlock tables;
+disconnect con1;
+create user foo;
+grant select,update on test.t1 to foo;
+connect foo,localhost,foo;
+update t1 set a=30 where a=3;
+disconnect foo;
+connection default;
+select * from t2;
+c d
+5 2
+4 10
+6 30
+drop table t2, t1;
+drop user foo;
+create table t1 (f1 int primary key) engine=innodb;
+create table t2 (f2 int primary key) engine=innodb;
+create table t3 (f3 int primary key, foreign key (f3) references t2(f2)) engine=innodb;
+insert into t1 values (1),(2),(3),(4),(5);
+insert into t2 values (1),(2),(3),(4),(5);
+insert into t3 values (1),(2),(3),(4),(5);
+connect con1,localhost,root;
+set debug_sync='alter_table_before_rename_result_table signal g1 wait_for g2';
+alter table t2 add constraint foreign key (f2) references t1(f1) on delete cascade on update cascade;
+connection default;
+set debug_sync='before_execute_sql_command wait_for g1';
+update t1 set f1 = f1 + 100000 limit 2;
+connect con2,localhost,root;
+kill query UPDATE;
+disconnect con2;
+connection default;
+ERROR 70100: Query execution was interrupted
+set debug_sync='now signal g2';
+connection con1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f2` int(11) NOT NULL,
+ PRIMARY KEY (`f2`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+disconnect con1;
+connection default;
+select * from t2 where f2 not in (select f1 from t1);
+f2
+select * from t3 where f3 not in (select f2 from t2);
+f3
+drop table t3;
+drop table t2;
+drop table t1;
+set debug_sync='reset';
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
new file mode 100644
index 00000000000..0d04f27f51f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/foreign_key.result
@@ -0,0 +1,19 @@
+SET FOREIGN_KEY_CHECKS=0;
+CREATE TABLE staff (
+staff_id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
+store_id TINYINT UNSIGNED NOT NULL,
+PRIMARY KEY (staff_id),
+KEY idx_fk_store_id (store_id),
+CONSTRAINT fk_staff_store FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE RESTRICT ON UPDATE CASCADE
+) ENGINE=InnoDB;
+CREATE TABLE store (
+store_id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
+manager_staff_id TINYINT UNSIGNED NOT NULL,
+PRIMARY KEY (store_id),
+UNIQUE KEY idx_unique_manager (manager_staff_id),
+CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
+) ENGINE=InnoDB;
+SET FOREIGN_KEY_CHECKS=DEFAULT;
+LOCK TABLE staff WRITE;
+UNLOCK TABLES;
+DROP TABLES staff, store;
diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test
index 2d586e2d6be..7ef440b260b 100644
--- a/mysql-test/suite/innodb/t/foreign-keys.test
+++ b/mysql-test/suite/innodb/t/foreign-keys.test
@@ -1,5 +1,8 @@
--source include/have_innodb.inc
--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+--enable_connect_log
--echo #
--echo # Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE
@@ -24,3 +27,87 @@ ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people`
(`people_id`);
drop table title, department, people;
+
+#
+# FK and prelocking:
+# child table accesses (reads and writes) wait for locks.
+#
+create table t1 (a int primary key, b int) engine=innodb;
+create table t2 (c int primary key, d int,
+ foreign key (d) references t1 (a) on update cascade) engine=innodb;
+insert t1 values (1,1),(2,2),(3,3);
+insert t2 values (4,1),(5,2),(6,3);
+flush table t2 with read lock; # this takes MDL_SHARED_NO_WRITE
+connect (con1,localhost,root);
+--error ER_ROW_IS_REFERENCED_2
+delete from t1 where a=2;
+send update t1 set a=10 where a=1;
+connection default;
+let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock';
+source include/wait_condition.inc;
+unlock tables;
+connection con1;
+reap;
+connection default;
+lock table t2 write; # this takes MDL_SHARED_NO_READ_WRITE
+connection con1;
+send delete from t1 where a=2;
+connection default;
+let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock';
+source include/wait_condition.inc;
+unlock tables;
+connection con1;
+--error ER_ROW_IS_REFERENCED_2
+reap;
+connection default;
+unlock tables;
+disconnect con1;
+
+# but privileges should not be checked
+create user foo;
+grant select,update on test.t1 to foo;
+connect(foo,localhost,foo);
+update t1 set a=30 where a=3;
+disconnect foo;
+connection default;
+select * from t2;
+drop table t2, t1;
+drop user foo;
+
+#
+# MDEV-16465 Invalid (old?) table or database name or hang in ha_innobase::delete_table and log semaphore wait upon concurrent DDL with foreign keys
+#
+create table t1 (f1 int primary key) engine=innodb;
+create table t2 (f2 int primary key) engine=innodb;
+create table t3 (f3 int primary key, foreign key (f3) references t2(f2)) engine=innodb;
+insert into t1 values (1),(2),(3),(4),(5);
+insert into t2 values (1),(2),(3),(4),(5);
+insert into t3 values (1),(2),(3),(4),(5);
+connect con1,localhost,root;
+set debug_sync='alter_table_before_rename_result_table signal g1 wait_for g2';
+send alter table t2 add constraint foreign key (f2) references t1(f1) on delete cascade on update cascade;
+connection default;
+let $conn=`select connection_id()`;
+set debug_sync='before_execute_sql_command wait_for g1';
+send update t1 set f1 = f1 + 100000 limit 2;
+connect con2,localhost,root;
+let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock' and info like 'update t1 %';
+source include/wait_condition.inc;
+--replace_result $conn UPDATE
+eval kill query $conn;
+disconnect con2;
+connection default;
+error ER_QUERY_INTERRUPTED;
+reap;
+set debug_sync='now signal g2';
+connection con1;
+reap;
+show create table t2;
+disconnect con1;
+connection default;
+select * from t2 where f2 not in (select f1 from t1);
+select * from t3 where f3 not in (select f2 from t2);
+drop table t3;
+drop table t2;
+drop table t1;
+set debug_sync='reset';
diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test
new file mode 100644
index 00000000000..223a1596883
--- /dev/null
+++ b/mysql-test/suite/innodb/t/foreign_key.test
@@ -0,0 +1,25 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-12669 Circular foreign keys cause a loop and OOM upon LOCK TABLE
+#
+SET FOREIGN_KEY_CHECKS=0;
+CREATE TABLE staff (
+ staff_id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ store_id TINYINT UNSIGNED NOT NULL,
+ PRIMARY KEY (staff_id),
+ KEY idx_fk_store_id (store_id),
+ CONSTRAINT fk_staff_store FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE RESTRICT ON UPDATE CASCADE
+) ENGINE=InnoDB;
+CREATE TABLE store (
+ store_id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ manager_staff_id TINYINT UNSIGNED NOT NULL,
+ PRIMARY KEY (store_id),
+ UNIQUE KEY idx_unique_manager (manager_staff_id),
+ CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
+) ENGINE=InnoDB;
+SET FOREIGN_KEY_CHECKS=DEFAULT;
+
+LOCK TABLE staff WRITE;
+UNLOCK TABLES;
+DROP TABLES staff, store;
diff --git a/mysql-test/suite/maria/create.result b/mysql-test/suite/maria/create.result
new file mode 100644
index 00000000000..82c6b8c9871
--- /dev/null
+++ b/mysql-test/suite/maria/create.result
@@ -0,0 +1,33 @@
+CREATE OR REPLACE TABLE t1 (
+f1 DECIMAL(43,0) NOT NULL,
+f2 TIME(4) NULL,
+f3 BINARY(101) NULL,
+f4 TIMESTAMP(4) NULL,
+f5 DATETIME(1) NULL,
+f6 SET('a','b','c') NOT NULL DEFAULT 'a',
+f7 VARBINARY(2332) NOT NULL DEFAULT '',
+f8 DATE NULL,
+f9 BLOB NULL,
+f10 MEDIUMINT(45) NOT NULL DEFAULT 0,
+f11 YEAR NULL,
+f12 BIT(58) NULL,
+v2 TIME(1) AS (f2) VIRTUAL,
+v3 BINARY(115) AS (f3) VIRTUAL,
+v4 TIMESTAMP(3) AS (f4) VIRTUAL,
+v7 VARBINARY(658) AS (f7) PERSISTENT,
+v8 DATE AS (f8) PERSISTENT,
+v9 TINYTEXT AS (f9) PERSISTENT,
+v11 YEAR AS (f11) VIRTUAL
+) ENGINE=Aria;
+INSERT IGNORE INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12) VALUES
+(0.8,'16:01:46',NULL,'2006-03-01 12:44:34','2029-10-10 21:27:53','a','foo','1989-12-24','bar',9,1975,b'1');
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a INT(45));
+INSERT IGNORE INTO t1 VALUES (1),(2);
+CREATE OR REPLACE TABLE t2 ENGINE=Aria AS SELECT SUM(a) AS f1, IFNULL( 'qux', ExtractValue( 'foo', 'bar' ) ) AS f2 FROM t1;
+select * from t2;
+f1 f2
+3 qux
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/maria/create.test b/mysql-test/suite/maria/create.test
new file mode 100644
index 00000000000..8f2ffd7492f
--- /dev/null
+++ b/mysql-test/suite/maria/create.test
@@ -0,0 +1,42 @@
+--source include/have_maria.inc
+
+# MDEV-17021
+# Server crash or assertion `length <= column->length' failure in
+# write_block_record
+#
+
+CREATE OR REPLACE TABLE t1 (
+ f1 DECIMAL(43,0) NOT NULL,
+ f2 TIME(4) NULL,
+ f3 BINARY(101) NULL,
+ f4 TIMESTAMP(4) NULL,
+ f5 DATETIME(1) NULL,
+ f6 SET('a','b','c') NOT NULL DEFAULT 'a',
+ f7 VARBINARY(2332) NOT NULL DEFAULT '',
+ f8 DATE NULL,
+ f9 BLOB NULL,
+ f10 MEDIUMINT(45) NOT NULL DEFAULT 0,
+ f11 YEAR NULL,
+ f12 BIT(58) NULL,
+ v2 TIME(1) AS (f2) VIRTUAL,
+ v3 BINARY(115) AS (f3) VIRTUAL,
+ v4 TIMESTAMP(3) AS (f4) VIRTUAL,
+ v7 VARBINARY(658) AS (f7) PERSISTENT,
+ v8 DATE AS (f8) PERSISTENT,
+ v9 TINYTEXT AS (f9) PERSISTENT,
+ v11 YEAR AS (f11) VIRTUAL
+) ENGINE=Aria;
+INSERT IGNORE INTO t1 (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12) VALUES
+ (0.8,'16:01:46',NULL,'2006-03-01 12:44:34','2029-10-10 21:27:53','a','foo','1989-12-24','bar',9,1975,b'1');
+DROP TABLE t1;
+
+#
+# MDEV-17067 Server crash in write_block_record
+#
+
+CREATE OR REPLACE TABLE t1 (a INT(45));
+INSERT IGNORE INTO t1 VALUES (1),(2);
+
+CREATE OR REPLACE TABLE t2 ENGINE=Aria AS SELECT SUM(a) AS f1, IFNULL( 'qux', ExtractValue( 'foo', 'bar' ) ) AS f2 FROM t1;
+select * from t2;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index 2618327c716..9c8565d0f03 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -2732,6 +2732,10 @@ id name
-1 dog
2 cat
DROP TABLE t1;
+CREATE TABLE t1 (pk int, i2 int) ENGINE=Aria;
+INSERT INTO t1 VALUES (1,2), (2,3),(3,4);
+DELETE FROM tt.*, t1.* USING t1 AS tt LEFT JOIN t1 ON (tt.i2 = t1.pk);
+DROP TABLE t1;
#
# End of 5.5 tests
#
diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test
index 6c080e484ce..9616933e363 100644
--- a/mysql-test/suite/maria/maria.test
+++ b/mysql-test/suite/maria/maria.test
@@ -2002,6 +2002,16 @@ INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
DROP TABLE t1;
+#
+# MDEV-16682
+# Assertion `(buff[7] & 7) == HEAD_PAGE' failed.
+#
+
+CREATE TABLE t1 (pk int, i2 int) ENGINE=Aria;
+INSERT INTO t1 VALUES (1,2), (2,3),(3,4);
+DELETE FROM tt.*, t1.* USING t1 AS tt LEFT JOIN t1 ON (tt.i2 = t1.pk);
+DROP TABLE t1;
+
--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
index c30bac3d8c0..efe8155ec08 100644
--- a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
@@ -37,8 +37,7 @@ SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS t1,t2,t3;
SET FOREIGN_KEY_CHECKS=1;
create table t1 (b int primary key) engine = INNODB;
-create table t2 (a int primary key, b int, foreign key (b) references t1(b))
-engine = INNODB;
+create table t2 (a int primary key, b int, foreign key (b) references t1(b)) engine = INNODB;
insert into t1 set b=1;
insert into t2 set a=1, b=1;
set foreign_key_checks=0;
diff --git a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
index ed28c2e9d1c..53db1723325 100644
--- a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
@@ -1,3 +1,61 @@
-- source include/have_innodb.inc
-let $engine_type=INNODB;
--- source extra/rpl_tests/rpl_foreign_key.test
+
+# Check the replication of the FOREIGN_KEY_CHECKS variable.
+
+-- source include/master-slave.inc
+
+CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=INNODB;
+CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=INNODB;
+
+SET FOREIGN_KEY_CHECKS=0;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL);
+INSERT INTO t2 VALUES (5,0);
+INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID());
+SET FOREIGN_KEY_CHECKS=1;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY b;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY b;
+
+connection master;
+SET TIMESTAMP=1000000000;
+CREATE TABLE t3 ( a INT UNIQUE );
+SET FOREIGN_KEY_CHECKS=0;
+--error ER_DUP_ENTRY
+INSERT INTO t3 VALUES (1),(1);
+sync_slave_with_master;
+
+connection master;
+SET FOREIGN_KEY_CHECKS=0;
+DROP TABLE IF EXISTS t1,t2,t3;
+SET FOREIGN_KEY_CHECKS=1;
+sync_slave_with_master;
+
+#
+# Bug #32468 delete rows event on a table with foreign key constraint fails
+#
+
+connection master;
+
+create table t1 (b int primary key) engine = INNODB;
+create table t2 (a int primary key, b int, foreign key (b) references t1(b)) engine = INNODB;
+
+insert into t1 set b=1;
+insert into t2 set a=1, b=1;
+
+set foreign_key_checks=0;
+delete from t1;
+
+--echo must sync w/o a problem (could not with the buggy code)
+sync_slave_with_master;
+select count(*) from t1 /* must be zero */;
+
+
+# cleanup for bug#32468
+
+connection master;
+drop table t2,t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index ca43e8d4e2f..9decb5604e8 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -1478,6 +1478,21 @@ SELECT LENGTH(CONCAT(t2,'--',t2)) c2 FROM (SELECT ST_BUFFER(POINT(x,y), 0) t2 FR
DROP TABLE t1;
SET optimizer_switch=@save_optimizer_switch;
+--echo #
+--echo # MDEV-16995: ER_CANT_CREATE_GEOMETRY_OBJECT encountered for a query with
+--echo # optimizer_use_condition_selectivity>=3
+--echo #
+
+CREATE TABLE t1 (a POINT);
+INSERT INTO t1 VALUES (POINT(1,1)),(POINT(1,2)),(POINT(1,3));
+set @save_use_stat_tables= @@use_stat_tables;
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set @@use_stat_tables= PREFERABLY;
+set @@optimizer_use_condition_selectivity=3;
+SELECT COUNT(*) FROM t1 WHERE a IN ('test','test1');
+set @@use_stat_tables= @save_use_stat_tables;
+set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1;
--echo #
--echo # End 10.0 tests
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index adad9073235..e8245dd2898 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -1519,6 +1519,23 @@ ALTER TABLE t1 ADD KEY(id,a);
SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=DATE'2001-01-04' GROUP BY id;
DROP TABLE t1;
+--echo #
+--echo # MDEV-17039: Query plan changes when we use GROUP BY optimization with optimizer_use_condition_selectivity=4
+--echo # and use_stat_tables= PREFERABLY
+--echo #
+
+CREATE TABLE t1 (a INT, b INT,c INT DEFAULT 0, INDEX (a,b));
+INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5),
+(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set @save_use_stat_tables= @@use_stat_tables;
+set @@optimizer_use_condition_selectivity=4;
+set @@use_stat_tables=PREFERABLY;
+explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+set @@use_stat_tables=@save_use_stat_tables;
+explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
+drop table t1;
--echo #
--echo # End of 10.0 tests
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 8a088de91cc..3d2a02e2346 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -1185,12 +1185,13 @@ CREATE TABLE t (f INT);
#
# The following shouldn't fail as the table is now matching the using
#
---error ER_BAD_FIELD_ERROR
CALL p;
DROP TABLE t;
CREATE TABLE t (i INT);
--error ER_BAD_FIELD_ERROR
CALL p;
+--error ER_BAD_FIELD_ERROR
+CALL p;
DROP PROCEDURE p;
DROP TABLE t;
diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test
index cf12bdaea21..3df49456332 100644
--- a/mysql-test/t/selectivity.test
+++ b/mysql-test/t/selectivity.test
@@ -1066,3 +1066,39 @@ drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
+
+--echo #
+--echo # MDEV-15306: Wrong/Unexpected result with the value
+--echo # optimizer_use_condition_selectivity set to 4
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+delimiter |;
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+ SET @cnt := @cnt + 1;
+ RETURN 1;
+END;|
+delimiter ;|
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @save_use_stat_tables= @@use_stat_tables;
+set @@use_stat_tables='complementary';
+set @@optimizer_use_condition_selectivity=4;
+SET @cnt= 0;
+SELECT * FROM t1 WHERE a = f1();
+SELECT @cnt;
+
+set @@use_stat_tables='preferably';
+analyze table t1 persistent for all;
+SET @cnt := 0;
+set @@optimizer_use_condition_selectivity=4;
+SELECT * FROM t1 WHERE a = f1();
+SELECT @cnt;
+alter table t1 force;
+set @@use_stat_tables= @save_use_stat_tables;
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+drop table t1;
+drop function f1;
+
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 467d3b5a7d4..2cdcc860506 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9349,6 +9349,27 @@ where 1=1;
drop function if exists f1;
drop table t1,t2;
+--echo #
+--echo # MDEV-16957: Server crashes in Field_iterator_natural_join::next
+--echo # upon 2nd execution of SP
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(32));
+CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1 AS t1y USING (c);
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+alter table t1 add column c int;
+CALL sp;
+
+# Cleanup
+DROP PROCEDURE sp;
+DROP TABLE t1;
+
+
--echo # End of 5.5 test
--echo #
diff --git a/mysql-test/t/stat_tables.test b/mysql-test/t/stat_tables.test
index 2c9c1eca7d3..c318cc5e75f 100644
--- a/mysql-test/t/stat_tables.test
+++ b/mysql-test/t/stat_tables.test
@@ -358,6 +358,18 @@ DROP TABLE t1;
set use_stat_tables=@save_use_stat_tables;
--echo #
+--echo # MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
+--echo #
+
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @@optimizer_use_condition_selectivity=4;
+set @@use_stat_tables= PREFERABLY;
+explain
+SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
+set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+set use_stat_tables=@save_use_stat_tables;
+
+--echo #
--echo # MDEV-16757: manual addition of min/max statistics for BLOB
--echo #
diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests
index c59b9725754..b52f45815fa 100644
--- a/mysql-test/unstable-tests
+++ b/mysql-test/unstable-tests
@@ -23,20 +23,15 @@
#
##############################################################################
-# Based on 10.1 701f0b8e366f957e8256e4741ca48424c84b7234
+# Based on bb-10.1-release f95d26b4d3ec0e4b039e80439f85e4f22bd79fe7
-main.alter_table : Modified in 10.1.34
main.alter_table_trans : MDEV-12084 - timeout
main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result
-main.assign_key_cache : Added in 10.1.34
-main.assign_key_cache_debug : Added in 10.1.34
main.auth_named_pipe : MDEV-14724 - System error 2
main.auto_increment : Modified in 10.1.35
main.bootstrap : Modified in 10.1.35
-main.connect_debug : Added in 10.0.36
main.count_distinct2 : MDEV-11768 - timeout
main.create_delayed : MDEV-10605 - failed with timeout
-main.create_or_replace : Modified in 10.1.34
main.ctype_binary : Modified in 10.1.35
main.ctype_eucjpms : Modified in 10.1.35
main.ctype_euckr : Modified in 10.1.35
@@ -56,65 +51,57 @@ main.events_2 : MDEV-13277 - Server crash
main.events_bugs : MDEV-12892 - Crash in fill_schema_processlist
main.events_slowlog : MDEV-12821 - Wrong result
main.events_restart : MDEV-12236 - Server shutdown problem
-main.gis : MDEV-13411 - wrong result on P8
+main.flush : Modified in 10.1.36
+main.func_isnull : Modified in 10.1.36
+main.func_time : Modified in 10.1.36
+main.gis : MDEV-13411 - wrong result on P8; modified in 10.1.36
main.grant : Modified in 10.1.35
-main.grant_not_windows : Added in 10.1.34
-main.grant2 : Modified in 10.0.36
+main.group_min_max : Modified in 10.1.36
main.having : Modified in 10.1.35
main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown
main.index_intersect_innodb : MDEV-10643 - failed with timeout
main.index_merge_innodb : MDEV-7142 - Wrong execution plan, timeout with valgrind
main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure
-main.insert_select : Modified in 10.1.34
-main.join : Modified in 10.1.35
+main.join : Modified in 10.1.36
main.join_cache : Modified in 10.1.35
main.join_outer : Modified in 10.1.35
main.kill_processlist-6619 : MDEV-10793 - wrong result in processlist
-main.limit : Modified in 10.1.34
main.log_tables-big : MDEV-13408 - wrong result
main.max_statement_time : Modified in 10.1.35
main.mdev-504 : MDEV-10607 - sporadic "can't connect"
main.mdev375 : MDEV-10607 - sporadic "can't connect"
main.merge : MDEV-10607 - sporadic "can't connect"
-main.myisam : Modified in 10.1.34
-main.mysql : Modified in 10.1.34
+main.mysql : Modified in 10.1.36
+main.mysql_not_windows : Modified in 10.1.36
main.mysql_client_test_nonblock : MDEV-15096 - exec failed
-main.mysql_cp932 : Modified in 10.1.34
main.mysql_upgrade_noengine : MDEV-14355 - Plugin is busy
-main.mysqldump : Modified in 10.1.34
main.mysqlhotcopy_myisam : MDEV-10995 - test hangs on debug build
-main.mysqlslap : MDEV-11801 - timeout; modified in 10.1.34
+main.mysqlslap : MDEV-11801 - timeout
main.mysqltest : MDEV-9269 - fails on Alpha
-main.olap : Modified in 10.1.34
main.order_by_optimizer_innodb : MDEV-10683 - wrong execution plan
main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock
main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings
-main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; modified in 10.1.34
+main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count
main.query_cache : MDEV-12895 - Wrong result
main.query_cache_debug : MDEV-15281 - Resize or similar command in progress
main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away
-main.read_only_innodb : Modified in 10.1.34
main.rename : Modified in 10.1.35
-main.selectivity : Modified in 10.1.34
+main.selectivity : Modified in 10.1.36
main.set_statement : MDEV-13183 - Wrong result
main.show_explain : MDEV-10674 - sporadic failure
-main.sp : Modified in 10.1.34
-main.sp-innodb : Modified in 10.0.36
+main.sp : Modified in 10.1.36
main.sp_notembedded : MDEV-10607 - internal error
main.sp-security : MDEV-10607 - sporadic "can't connect"
-main.stat_tables : Modified in 10.1.35
+main.stat_tables : Modified in 10.1.36
main.stat_tables_par_innodb : MDEV-14155 - wrong rounding
main.statistics : Modified in 10.1.35
-main.statistics_close : Added in 10.1.34
main.status : MDEV-8510 - sporadic wrong result
main.subselect : Modified in 10.1.35
+main.subselect_extra_no_semijoin : Modified in 10.1.36
main.subselect_innodb : MDEV-10614 - sporadic wrong results
-main.subselect_sj : Modified in 10.0.36
main.subselect_sj_mat : Modified in 10.1.35
main.subselect_sj2_mat : Modified in 10.1.35
-main.subselect4 : Modified in 10.0.36
main.tc_heuristic_recover : MDEV-15200 - wrong error on mysqld_stub_cmd
-main.trigger : Modified in 10.1.34
main.type_blob : MDEV-15195 - Wrong result
main.type_datetime : MDEV-14322 - wrong result
main.type_datetime_hires : MDEV-10687 - timeout
@@ -134,12 +121,14 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed
binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed
binlog.binlog_flush_binlogs_delete_domain : MDEV-14431 - Wrong error code
+binlog.binlog_incident : Modified in 10.1.36
binlog.binlog_killed : MDEV-12925 - Wrong result
binlog.binlog_tmp_table_row : Added in 10.1.35
binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
#----------------------------------------------------------------
+binlog_encryption.binlog_incident : Modified in 10.1.36
binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint
binlog_encryption.encrypted_master : MDEV-12906 - Failed to sync
binlog_encryption.rpl_parallel : MDEV-10653 - Timeout
@@ -147,6 +136,7 @@ binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout
binlog_encryption.rpl_semi_sync : MDEV-11220 - Wrong result, MDEV-11673 - Valgrind warning
binlog_encryption.rpl_ssl : MDEV-14507 - Timeout on SLES 11.4
binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL server during query
+binlog.load_data_stm_view : MDEV-16948 - Wrong result
#----------------------------------------------------------------
@@ -158,25 +148,17 @@ connect.zip : MDEV-13884 - Wrong result
encryption.create_or_replace : MDEV-16115 - Trying to access tablespace
encryption.debug_key_management : MDEV-13841 - Timeout on wait condition
encryption.encrypt_and_grep : MDEV-13765 - Wrong result
-encryption.innodb-bad-key-change : Modified in 10.1.34
-encryption.innodb-bad-key-change2 : Modified in 10.1.34
-encryption.innodb-bad-key-change4 : Modified in 10.1.34
encryption.innodb-checksum-algorithm : MDEV-16896 - Server crash
-encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate; modified in 10.1.34
-encryption.innodb-discard-import : Modified in 10.1.34
-encryption.innodb-encryption-disable : Modified in 10.1.34
+encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate
encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result
encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure
encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash
encryption.innodb_first_page : MDEV-10689 - Crash
encryption.innodb-first-page-read : MDEV-14356 - Timeout on wait condition
-encryption.innodb-force-corrupt : Modified in 10.1.34
encryption.innodb_lotoftables : MDEV-16111 - Wrong result
-encryption.innodb-missing-key : Modified in 10.1.34
encryption.innodb-page_encryption : MDEV-10641 - mutex problem
encryption.innodb-read-only : MDEV-14728 - Unable to get certificate; MDEV-16563 - Crash on startup
-encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup; modified in 10.1.34
-encryption.innodb-redo-nokeys : Modified in 10.1.34
+encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup
encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition
encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing
encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing
@@ -190,7 +172,6 @@ engines/rr_trx.* : MDEV-10998 - tests not maintained
#----------------------------------------------------------------
-federated.assisted_discovery : Include file modified in 10.0.36
federated.federated_bug_35333 : MDEV-13410 - Wrong result
federated.federated_bug_585688 : MDEV-12907 - Valgrind, MDEV-14805 - server crash
federated.federated_innodb : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips
@@ -200,7 +181,6 @@ federated.federatedx : MDEV-10617 - Wrong checksum, timeouts
#----------------------------------------------------------------
-funcs_1.is_engines_federated : Include file modified in 10.0.36
funcs_1.memory_views : MDEV-11773 - timeout
funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result
funcs_1.processlist_val_ps : MDEV-12175 - Wrong plan
@@ -214,68 +194,45 @@ funcs_2/charset.* : MDEV-10999 - test not maintained
galera.* : The suite was enabled in 10.1.27 and is still unstable
galera_3nodes.* : The suite has not been stabilized yet
-galera.galera_applier_ftwrl_table_alter : MDEV-13738 - MySQL server has gone away
-galera.galera_gcs_fc_limit : MDEV-13877 - Timeout
-galera.galera_suspend_slave : MDEV-13873 - Wrong error code
-galera.galera_toi_truncate : MDEV-13743 - query 'reap' succeeded
-galera.galera_unicode_identifiers : MDEV-13871 - Unknown database
-galera.galera_var_node_address : MDEV-13880 - Failed to start mysqld
-galera.galera_wan : MDEV-13879 - Stray state UUID msg warnings
-galera.galera_wsrep_log_conficts : MDEV-13874 - check-testcase failed
-galera.partition : MDEV-13881 - Wrong result
-galera.query_cache : MDEV-13883 - Wrong result
-galera.MW-328A : MDEV-13876 - Wrong result
-
-#----------------------------------------------------------------
-
-handler.ps : Added in 10.1.34
-
#----------------------------------------------------------------
heap.heap_auto_increment : Modified in 10.1.35
#----------------------------------------------------------------
-innodb.alter_partitioned_xa : Added in 10.0.36
innodb.binlog_consistent : MDEV-10618 - Server fails to start
innodb.doublewrite : MDEV-12905 - Lost connection to MySQL server
-innodb.group_commit_crash : MDEV-11770 - checksum mismatch
+innodb.foreign-keys : Modified in 10.1.36
+innodb.foreign_key : Added in 10.1.36
+innodb.group_commit_crash : MDEV-11770 - checksum mismatch
innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - checksum mismatch
innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup
-innodb.innodb-alter : Added in 10.1.34
innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS
innodb.innodb-alter-table : MDEV-10619 - Testcase timeout
-innodb.innodb-blob : MDEV-12053 - Client crash; modified in 10.1.34
+innodb.innodb-blob : MDEV-12053 - Client crash
innodb.innodb_bug14147491 : MDEV-11808 - wrong error codes
innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan
innodb.innodb_bug48024 : MDEV-14352 - Assertion failure
-innodb.innodb_bug54044 : Modified in 10.1.34
-innodb.innodb_defragment_small : Modified in 10.1.34
innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown
+innodb.innodb-lock : Modified in 10.1.36
innodb.innodb_max_recordsize_64k : MDEV-15203 - wrong result
-innodb.innodb-mdev7046 : Modified in 10.1.34
innodb.innodb_monitor : MDEV-10939 - Testcase timeout
-innodb.innodb-page_compression_default : Modified in 10.1.34
+innodb.innodb-page_compression_default : MDEV-14121 - Assertion failure
innodb.innodb-page_compression_lzma : MDEV-14353 - wrong result on Fedora 25
-innodb.innodb-page_compression_snappy : Modified in 10.1.34
innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem
innodb.innodb_stats : MDEV-10682 - wrong result
innodb.innodb_sys_semaphore_waits : MDEV-10331 - wrong result
innodb.innodb-wl5522 : Modified in 10.1.35
innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks
-innodb.lock_deleted : Added in 10.1.34
innodb.log_file_size : MDEV-15668 - Not found pattern
innodb.recovery_shutdown : MDEV-15671 - Warning: database page corruption
-innodb.rename_table : Added in 10.1.34
innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace
-innodb.sp_temp_table : MDEV-16647 - Could not remove temporary table
innodb.table_definition_cache_debug : MDEV-14206 - Extra warning
innodb.table_flags : MDEV-14363 - Operating system error number 2
innodb.xa_recovery : MDEV-15279 - mysqld got exception
#----------------------------------------------------------------
-innodb_fts.basic : Added in 10.1.34
innodb_fts.fts_kill_query : Added in 10.1.35
innodb_fts.innodb-fts-fic : MDEV-14154 - Assertion failure
innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning
@@ -283,15 +240,14 @@ innodb_fts.sync_ddl : Added in 10.1.35
#----------------------------------------------------------------
-maria.alter : Modified in 10.1.34
+maria.concurrent : Added in 10.1.36
+maria.create : Added in 10.1.36
maria.insert_select : MDEV-12757 - Timeout
maria.insert_select-7314 : MDEV-16492 - Timeout
-maria.lock : Modified in 10.1.34
-maria.maria : MDEV-14430 - Wrong result; modified in 10.1.35
+maria.maria : MDEV-14430 - Wrong result; modified in 10.1.36
#----------------------------------------------------------------
-mariabackup.backup_ssl : Added in 10.1.34
mariabackup.incremental_encrypted : MDEV-15667 - Timeout
mariabackup.mdev-14447 : MDEV-15201 - Timeout
mariabackup.xb_compressed_encrypted : MDEV-14812 - Segfault
@@ -333,7 +289,6 @@ parts.truncate_locked : Added in 10.1.35
perfschema.func_file_io : MDEV-5708 - fails for s390x
perfschema.func_mutex : MDEV-5708 - fails for s390x
perfschema.hostcache_ipv6_ssl : MDEV-10696 - crash on shutdown
-perfschema.partition : Added in 10.1.34
perfschema.privilege_table_io : MDEV-13184 - Extra lines
perfschema.rpl_gtid_func : MDEV-16897 - Wrong result
perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match
@@ -348,7 +303,7 @@ perfschema_stress.* : MDEV-10996 - tests not maintained
plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url
plugins.processlist : Added in 10.1.35
-plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.1.34
+plugins.server_audit : MDEV-9562 - crashes on sol10-sparc
plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc
#----------------------------------------------------------------
@@ -358,7 +313,6 @@ roles.create_and_grant_role : MDEV-11772 - wrong result
#----------------------------------------------------------------
rpl.last_insert_id : MDEV-10625 - warnings in error log
-rpl.rename : Added in 10.1.34
rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips
rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips
rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log
@@ -368,6 +322,7 @@ rpl.rpl_ddl : MDEV-10417 - Fails on Mips
rpl.rpl_domain_id_filter_io_crash : MDEV-14357 - Wrong result
rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result
rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start
+rpl.rpl_foreign_key_innodb : Modified in 10.1.36
rpl.rpl_gtid_basic : MDEV-10681 - server startup problem
rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering on master
rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout in include
@@ -384,7 +339,6 @@ rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL se
rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips
rpl.rpl_mariadb_slave_capability : MDEV-11018 - sporadic wrong events in binlog
rpl.rpl_mdev6020 : MDEV-10417 - Fails on Mips
-rpl.rpl_mixed_implicit_commit_binlog : Modified in 10.1.34
rpl.rpl_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed
rpl.rpl_non_direct_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed
rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master pos wait
@@ -403,9 +357,9 @@ rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result
rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed
rpl.rpl_row_img_eng_min : MDEV-13875 - command "diff_files" failed
rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed
-rpl.rpl_row_implicit_commit_binlog : Modified in 10.1.34
rpl.rpl_row_index_choice : MDEV-15196 - Slave crash
rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x
+rpl.rpl_row_spatial : Added in 10.1.36
rpl.rpl_semi_sync : MDEV-11220 - Wrong result
rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result
rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result
@@ -416,7 +370,6 @@ rpl.rpl_show_slave_hosts : MDEV-10681 - server startup problem
rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha
rpl.rpl_slave_grp_exec : MDEV-10514 - Unexpected deadlock
rpl.rpl_start_stop_slave : MDEV-13567 - Replication failure
-rpl.rpl_stm_implicit_commit_binlog : Modified in 10.1.34
rpl.rpl_stm_mixing_engines : MDEV-14489 - Sync slave with master failed
rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion
rpl.rpl_sync : MDEV-10633 - Database page corruption
@@ -463,6 +416,8 @@ sys_vars.wait_timeout_func : MDEV-12896 - Wrong result
#----------------------------------------------------------------
+tokudb.* : suite.pm and multiple modifications in 10.1.36
+
tokudb.change_column_all_1000_10 : MDEV-12640 - Crash
tokudb.change_column_bin : MDEV-12640 - Crash
tokudb.change_column_char : MDEV-12822 - Lost connection to MySQL server
@@ -484,15 +439,18 @@ tokudb.type_datetime : MDEV-15193 - Wrong result
tokudb_backup.* : MDEV-11001 - tests don't work
+tokudb_bugs.alter_table_comment_rebuild_data : Added in 10.1.36
tokudb_bugs.checkpoint_lock : MDEV-10637 - Wrong processlist output
tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output
tokudb_bugs.frm_store : MDEV-12823 - Valgrind
tokudb_bugs.frm_store2 : MDEV-12823 - Valgrind
tokudb_bugs.frm_store3 : MDEV-12823 - Valgrind
+tokudb_bugs.PS-3773 : Added in 10.1.36
tokudb_bugs.xa : MDEV-11804 - Lock wait timeout
tokudb_rpl.* : MDEV-11001 - tests don't work
tokudb_sys_vars.* : MDEV-11001 - tests don't work
+
rpl-tokudb.* : MDEV-14354 - Tests fail with tcmalloc
#----------------------------------------------------------------
@@ -514,6 +472,6 @@ vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.1.35
wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node
wsrep.mdev_6832 : MDEV-14195 - Failure upon check-testcase
wsrep.pool_of_threads : MDEV-12234 - Library problem on Power
-wsrep.variables : Modified in 10.1.34
+wsrep.variables : Modified in 10.1.36
wsrep_info.plugin : MDEV-12909 - Wrong result