summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-14 18:06:51 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-14 18:06:51 +0300
commit1d15a28e52e41fae0847284089b2073ab33162a5 (patch)
tree3d2dbd3ebda6547c26642e597b5cafc56e7ed031 /mysql-test
parentc4feef50cfa4033e646636ed37e255d2b3593fbf (diff)
parenta20f6f9853e522ad388f5b968ce11af3c5d1fc10 (diff)
downloadmariadb-git-1d15a28e52e41fae0847284089b2073ab33162a5.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/wait_for_slave_param.inc2
-rw-r--r--mysql-test/main/alter_table.result18
-rw-r--r--mysql-test/main/alter_table.test18
-rw-r--r--mysql-test/main/connect_debug.test1
-rw-r--r--mysql-test/main/kill.result16
-rw-r--r--mysql-test/main/kill.test20
-rwxr-xr-xmysql-test/mysql-test-run.pl1
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result2
-rw-r--r--mysql-test/suite/galera/disabled.def3
-rw-r--r--mysql-test/suite/galera/r/MW-328A.result4
-rw-r--r--mysql-test/suite/galera/r/MW-328B.result2
-rw-r--r--mysql-test/suite/galera/r/MW-328C.result2
-rw-r--r--mysql-test/suite/galera/r/galera_performance_schema.result44
-rw-r--r--mysql-test/suite/galera/t/MW-328-footer.inc2
-rw-r--r--mysql-test/suite/galera/t/MW-328A.test3
-rw-r--r--mysql-test/suite/galera/t/MW-328B.test2
-rw-r--r--mysql-test/suite/galera/t/MW-328C.test3
-rw-r--r--mysql-test/suite/galera/t/MW-328D.test1
-rw-r--r--mysql-test/suite/galera/t/MW-328E.test1
-rw-r--r--mysql-test/suite/galera/t/galera_performance_schema.test58
-rw-r--r--mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc89
-rw-r--r--mysql-test/suite/innodb/r/alter_copy.result8
-rw-r--r--mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff51
-rw-r--r--mysql-test/suite/innodb/r/auto_increment_dup.result27
-rw-r--r--mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result229
-rw-r--r--mysql-test/suite/innodb/r/trx_id_future.result2
-rw-r--r--mysql-test/suite/innodb/t/alter_copy.test15
-rw-r--r--mysql-test/suite/innodb/t/auto_increment_dup.test8
-rw-r--r--mysql-test/suite/innodb/t/trx_id_future.test3
-rw-r--r--mysql-test/suite/mariabackup/big_innodb_log.result32
-rw-r--r--mysql-test/suite/mariabackup/big_innodb_log.test87
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev_17614.result129
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_unsafe_statements.result5
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test56
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection.test39
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev_17614.test121
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test41
-rw-r--r--mysql-test/suite/rpl/t/rpl_unsafe_statements.test2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result2
-rw-r--r--mysql-test/suite/sys_vars/r/table_open_cache_basic.result18
-rw-r--r--mysql-test/suite/sys_vars/t/table_open_cache_basic.test21
-rw-r--r--mysql-test/suite/versioning/r/alter.result35
-rw-r--r--mysql-test/suite/versioning/r/partition.result30
-rw-r--r--mysql-test/suite/versioning/r/partition_rotation.result2
-rw-r--r--mysql-test/suite/versioning/t/alter.test35
-rw-r--r--mysql-test/suite/versioning/t/partition.test39
50 files changed, 1059 insertions, 338 deletions
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc
index 25020d46ed9..b06dee3c640 100644
--- a/mysql-test/include/wait_for_slave_param.inc
+++ b/mysql-test/include/wait_for_slave_param.inc
@@ -69,7 +69,7 @@ if (!$_slave_param_comparison)
if ($rpl_debug)
{
- --echo Waiting until '$slave_param' $_slave_param_comparison '$slave_param_value' [timeout='$_slave_timeout', \$slave_error_param='$slave_error_param']
+ --echo Waiting until '$slave_param' $_slave_param_comparison '$slave_param_value' [\$slave_error_param='$slave_error_param']
}
--let $_slave_check_configured= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1)
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 5ae90459ff4..b5f81642db2 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -2540,3 +2540,21 @@ test.t1 analyze status OK
set @@use_stat_tables= @save_use_stat_tables;
set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1;
+#
+# MDEV-18154 Deadlock and assertion upon no-op ALTER under LOCK TABLES
+#
+create or replace table t1 (pk int, i int, primary key (pk)) engine myisam;
+create or replace view v1 as select * from t1;
+lock table v1 read, t1 write;
+alter table t1 change f1 f2 int;
+ERROR 42S22: Unknown column 'f1' in 't1'
+set max_statement_time= 1;
+alter table t1 add column if not exists i int after pk;
+Warnings:
+Note 1060 Duplicate column name 'i'
+set max_statement_time= 0;
+drop table t1;
+drop view v1;
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 0fab5575f13..5c29dfae6b3 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -2057,3 +2057,21 @@ analyze table t1;
set @@use_stat_tables= @save_use_stat_tables;
set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1;
+
+--echo #
+--echo # MDEV-18154 Deadlock and assertion upon no-op ALTER under LOCK TABLES
+--echo #
+create or replace table t1 (pk int, i int, primary key (pk)) engine myisam;
+create or replace view v1 as select * from t1;
+lock table v1 read, t1 write;
+--error ER_BAD_FIELD_ERROR
+alter table t1 change f1 f2 int;
+set max_statement_time= 1;
+alter table t1 add column if not exists i int after pk;
+set max_statement_time= 0;
+drop table t1;
+drop view v1;
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
diff --git a/mysql-test/main/connect_debug.test b/mysql-test/main/connect_debug.test
index 7a2f2872b79..300a2de0fbd 100644
--- a/mysql-test/main/connect_debug.test
+++ b/mysql-test/main/connect_debug.test
@@ -17,6 +17,7 @@ drop user bad;
#
set global debug_dbug='+d,auth_invalid_plugin';
create user 'bad' identified by 'worse';
+--replace_regex /loaded: [^\n]*/loaded: invalid plugin name/
--error 1
--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse 2>&1
set global debug_dbug=@old_dbug;
diff --git a/mysql-test/main/kill.result b/mysql-test/main/kill.result
index 4775d111b79..55839817fd4 100644
--- a/mysql-test/main/kill.result
+++ b/mysql-test/main/kill.result
@@ -399,3 +399,19 @@ DROP USER u1@localhost;
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
set global sql_mode=default;
+#
+# MDEV-17998
+# Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed
+# in tc_release_table on KILL_TIMEOUT
+#
+SET max_statement_time= 2;
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (b INT, c INT);
+LOCK TABLES v1 READ, t2 WRITE, t1 WRITE;
+ALTER TABLE t1 CHANGE f1 f2 DOUBLE;
+Got one of the listed errors
+ALTER TABLE t2 DROP c;
+UNLOCK TABLES;
+DROP VIEW v1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/main/kill.test b/mysql-test/main/kill.test
index 059d8d40b11..45d672aebc1 100644
--- a/mysql-test/main/kill.test
+++ b/mysql-test/main/kill.test
@@ -642,3 +642,23 @@ SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
set global sql_mode=default;
+
+--echo #
+--echo # MDEV-17998
+--echo # Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed
+--echo # in tc_release_table on KILL_TIMEOUT
+--echo #
+
+SET max_statement_time= 2;
+
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (b INT, c INT);
+
+LOCK TABLES v1 READ, t2 WRITE, t1 WRITE;
+--error ER_BAD_FIELD_ERROR,ER_STATEMENT_TIMEOUT
+ALTER TABLE t1 CHANGE f1 f2 DOUBLE;
+ALTER TABLE t2 DROP c;
+UNLOCK TABLES;
+DROP VIEW v1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 51f5617244c..4fb17300682 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -3369,6 +3369,7 @@ sub mysql_install_db {
# Create the bootstrap.sql file
# ----------------------------------------------------------------------
my $bootstrap_sql_file= "$opt_vardir/log/bootstrap.sql";
+ $ENV{'MYSQL_BOOTSTRAP_SQL_FILE'}= $bootstrap_sql_file;
if (! -e $bootstrap_sql_file)
{
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index d235237c69c..a8143ef086e 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -2675,6 +2675,8 @@ Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave
INSERT INTO insert_2_keys VALUES (1, 2)
ON DUPLICATE KEY UPDATE a=VALUES(a)+10, b=VALUES(b)+10;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
DROP TABLE filler_table;
DROP TABLE insert_table;
DROP TABLE update_table;
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index c141d41ed35..92a806710da 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -12,9 +12,6 @@
MW-286 : MDEV-19992 Galera test failure on MW-286
GCF-1081 : MDEV-18283 Galera test failure on galera.GCF-1081
-MW-328A : MDEV-17847 Galera test failure on MW-328[A|B|C]
-MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C]
-MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-329 : MDEV-19962 Galera test failure on MW-329
MW-360 : needs rewrite to be MariaDB gtid compatible
MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388
diff --git a/mysql-test/suite/galera/r/MW-328A.result b/mysql-test/suite/galera/r/MW-328A.result
index f4bb018b442..aab548bdc3c 100644
--- a/mysql-test/suite/galera/r/MW-328A.result
+++ b/mysql-test/suite/galera/r/MW-328A.result
@@ -22,7 +22,7 @@ Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
-CALL mtr.add_suppression("conflict state 3 after post commit");
+CALL mtr.add_suppression("conflict state ABORTED after post commit");
connection node_1;
CREATE TABLE t1 (i int primary key, j int) engine=innodb;
INSERT INTO t1 values (1,0);
@@ -32,7 +32,7 @@ connection node_2;
UPDATE t1 SET j=2 WHERE i=1;
connection node_1;
COMMIT;
-ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ERROR 40001: Deadlock: wsrep aborted transaction
SELECT * FROM t1;
i j
1 2
diff --git a/mysql-test/suite/galera/r/MW-328B.result b/mysql-test/suite/galera/r/MW-328B.result
index d29c3a50f3d..93a8685cc9e 100644
--- a/mysql-test/suite/galera/r/MW-328B.result
+++ b/mysql-test/suite/galera/r/MW-328B.result
@@ -22,4 +22,4 @@ Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
-CALL mtr.add_suppression("conflict state 3 after post commit");
+CALL mtr.add_suppression("conflict state ABORTED after post commit");
diff --git a/mysql-test/suite/galera/r/MW-328C.result b/mysql-test/suite/galera/r/MW-328C.result
index 748f9420764..7a00bb718de 100644
--- a/mysql-test/suite/galera/r/MW-328C.result
+++ b/mysql-test/suite/galera/r/MW-328C.result
@@ -22,4 +22,4 @@ Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
-CALL mtr.add_suppression("conflict state 3 after post commit");
+CALL mtr.add_suppression("conflict state ABORTED after post commit");
diff --git a/mysql-test/suite/galera/r/galera_performance_schema.result b/mysql-test/suite/galera/r/galera_performance_schema.result
new file mode 100644
index 00000000000..5b4994556d6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_performance_schema.result
@@ -0,0 +1,44 @@
+use performance_schema;
+SELECT name
+FROM threads
+WHERE name LIKE 'thread/sql/wsrep%'
+ORDER BY name;
+name thread/sql/wsrep_applier_thread
+name thread/sql/wsrep_rollbacker_thread
+use test;
+create table t1 (a int not null primary key) engine=innodb;
+insert into t1 values (1),(2);
+use performance_schema;
+select name from mutex_instances where name like 'wait/synch/mutex/sql/LOCK_wsrep%' order by name;
+name wait/synch/mutex/sql/LOCK_wsrep_config_state
+name wait/synch/mutex/sql/LOCK_wsrep_desync
+name wait/synch/mutex/sql/LOCK_wsrep_ready
+name wait/synch/mutex/sql/LOCK_wsrep_replaying
+name wait/synch/mutex/sql/LOCK_wsrep_rollback
+name wait/synch/mutex/sql/LOCK_wsrep_slave_threads
+name wait/synch/mutex/sql/LOCK_wsrep_sst
+name wait/synch/mutex/sql/LOCK_wsrep_sst_init
+select name from cond_instances where name like 'wait/synch/cond/sql/COND_wsrep%' order by name;
+name wait/synch/cond/sql/COND_wsrep_ready
+name wait/synch/cond/sql/COND_wsrep_replaying
+name wait/synch/cond/sql/COND_wsrep_rollback
+name wait/synch/cond/sql/COND_wsrep_sst
+name wait/synch/cond/sql/COND_wsrep_sst_init
+connection node_2;
+use test;
+SET SESSION wsrep_on=OFF;
+CREATE TABLE t2 (f1 INTEGER) engine=innodb;
+connection node_1;
+use test;
+CREATE TABLE t2 (f1 INTEGER) engine=innodb;
+connection node_2;
+SET SESSION wsrep_on=ON;
+SELECT COUNT(*) FROM t1;
+COUNT(*) 2
+use performance_schema;
+select count(*)>=1 from file_instances where file_name like '%GRA_%.log';
+count(*)>=1 1
+CALL mtr.add_suppression("Slave SQL: Error 'Table 't2' already exists' on query");
+use test;
+drop table t1;
+drop table t2;
diff --git a/mysql-test/suite/galera/t/MW-328-footer.inc b/mysql-test/suite/galera/t/MW-328-footer.inc
index 5b736df220f..12a4bf12590 100644
--- a/mysql-test/suite/galera/t/MW-328-footer.inc
+++ b/mysql-test/suite/galera/t/MW-328-footer.inc
@@ -15,4 +15,4 @@
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
-CALL mtr.add_suppression("conflict state 3 after post commit");
+CALL mtr.add_suppression("conflict state ABORTED after post commit");
diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test
index 097d4ac4ff6..dd692a292b8 100644
--- a/mysql-test/suite/galera/t/MW-328A.test
+++ b/mysql-test/suite/galera/t/MW-328A.test
@@ -12,9 +12,8 @@
# it all depends on timing.
#
---source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
+--source include/big_test.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
diff --git a/mysql-test/suite/galera/t/MW-328B.test b/mysql-test/suite/galera/t/MW-328B.test
index 000b0d8a9ab..11969dd0b47 100644
--- a/mysql-test/suite/galera/t/MW-328B.test
+++ b/mysql-test/suite/galera/t/MW-328B.test
@@ -7,9 +7,7 @@
# gets the deadlock error
#
---source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test
index 72a8480923c..1594547d0de 100644
--- a/mysql-test/suite/galera/t/MW-328C.test
+++ b/mysql-test/suite/galera/t/MW-328C.test
@@ -7,9 +7,8 @@
# masks all deadlock errors
#
---source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
+--source include/big_test.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
diff --git a/mysql-test/suite/galera/t/MW-328D.test b/mysql-test/suite/galera/t/MW-328D.test
index d5cffdb8f47..e8a22f22a99 100644
--- a/mysql-test/suite/galera/t/MW-328D.test
+++ b/mysql-test/suite/galera/t/MW-328D.test
@@ -7,7 +7,6 @@
#
--source include/galera_cluster.inc
---source include/have_innodb.inc
CREATE TABLE t1 (i INT) ENGINE = InnoDB;
INSERT INTO t1 (i) VALUES(1);
diff --git a/mysql-test/suite/galera/t/MW-328E.test b/mysql-test/suite/galera/t/MW-328E.test
index fd4b0bf9039..34b17be7b08 100644
--- a/mysql-test/suite/galera/t/MW-328E.test
+++ b/mysql-test/suite/galera/t/MW-328E.test
@@ -7,7 +7,6 @@
#
--source include/galera_cluster.inc
---source include/have_innodb.inc
create table t1 (i int primary key, j int) engine=innodb;
create table t2 (i int primary key, j int) engine=innodb;
diff --git a/mysql-test/suite/galera/t/galera_performance_schema.test b/mysql-test/suite/galera/t/galera_performance_schema.test
new file mode 100644
index 00000000000..d54555ea301
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_performance_schema.test
@@ -0,0 +1,58 @@
+#
+# Test that wsrep mutexes, condition variables, files and
+# threads are shown in performance schema
+#
+--source include/galera_cluster.inc
+--source include/have_perfschema.inc
+
+use performance_schema;
+
+--vertical_results
+--disable_ps_protocol
+SELECT name
+FROM threads
+WHERE name LIKE 'thread/sql/wsrep%'
+ORDER BY name;
+--enable_ps_protocol
+
+use test;
+create table t1 (a int not null primary key) engine=innodb;
+insert into t1 values (1),(2);
+
+use performance_schema;
+select name from mutex_instances where name like 'wait/synch/mutex/sql/LOCK_wsrep%' order by name;
+select name from cond_instances where name like 'wait/synch/cond/sql/COND_wsrep%' order by name;
+# Whenever a node fails to apply an event on a slave node, the database server creates a
+# special binary log file of the event in the data directory. The naming convention the
+# node uses for the filename is GRA_*.log.
+# Thus, we need to produce a applier failure
+
+--connection node_2
+--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
+
+# Create applier failure
+
+use test;
+SET SESSION wsrep_on=OFF;
+CREATE TABLE t2 (f1 INTEGER) engine=innodb;
+
+--connection node_1
+use test;
+CREATE TABLE t2 (f1 INTEGER) engine=innodb;
+
+--connection node_2
+SET SESSION wsrep_on=ON;
+SELECT COUNT(*) FROM t1;
+
+use performance_schema;
+#
+# Below we can't just count number of files as if you run this test more
+# than once, test will create more files
+#
+select count(*)>=1 from file_instances where file_name like '%GRA_%.log';
+CALL mtr.add_suppression("Slave SQL: Error 'Table 't2' already exists' on query");
+
+use test;
+drop table t1;
+drop table t2;
+
diff --git a/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc b/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc
index 48de3a1962d..85466e5e4ae 100644
--- a/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc
+++ b/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc
@@ -4,17 +4,8 @@
# Not supported in embedded
-- source include/not_embedded.inc
-
-# This test case needs to crash the server. Needs a debug server.
-- source include/have_debug.inc
-
-# Don't test this under valgrind, memory leaks will occur.
--- source include/not_valgrind.inc
-
-# Avoid CrashReporter popup on Mac
--- source include/not_crashrep.inc
-
--- source include/have_innodb.inc
+-- source include/have_debug_sync.inc
# Create Insert Procedure
DELIMITER |;
@@ -62,21 +53,11 @@ CALL populate_t1();
SELECT COUNT(*) FROM t1;
+--enable_info
CREATE INDEX idx_title ON t1(title);
+--disable_info
---source include/restart_mysqld.inc
-
-CHECK TABLE t1;
-
-SELECT * FROM t1 WHERE title = 'a10';
-
-SELECT * FROM t1 WHERE title = 'a5000';
-
-SELECT * FROM t1 WHERE title = 'a10000';
-
-SELECT * FROM t1 WHERE title = 'a10010';
-
-DROP TABLE t1;
+RENAME TABLE t1 TO t0;
-- echo # Test Blob
@@ -104,16 +85,32 @@ INSERT INTO t1 VALUES
SELECT CHAR_LENGTH(b) FROM t1;
-ALTER TABLE t1 DROP COLUMN c;
+--enable_info
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+--disable_info
--source include/restart_mysqld.inc
-CHECK TABLE t1;
+CHECK TABLE t0,t1;
SELECT CHAR_LENGTH(b) FROM t1;
DROP TABLE t1;
+RENAME TABLE t0 to t1;
+
+CHECK TABLE t1;
+
+SELECT * FROM t1 WHERE title = 'a10';
+
+SELECT * FROM t1 WHERE title = 'a5000';
+
+SELECT * FROM t1 WHERE title = 'a10000';
+
+SELECT * FROM t1 WHERE title = 'a10010';
+
+DROP TABLE t1;
+
# Test Crash Recovery
if ($row_format != 'COMPRESSED')
@@ -140,17 +137,16 @@ if ($row_format == 'COMPRESSED')
CALL populate_t1();
-- enable_query_log
-SET debug_dbug='+d,crash_commit_before';
-
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
---error 2013
+connect (hang,localhost,root);
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
+send
CREATE INDEX idx_title ON t1(title);
---enable_reconnect
---source include/wait_until_connected_again.inc
---disable_reconnect
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+let $shutdown_timeout=0;
+--source include/restart_mysqld.inc
+disconnect hang;
SELECT COUNT(*) FROM t1;
@@ -194,17 +190,16 @@ INSERT INTO t1 VALUES
SELECT CHAR_LENGTH(b) FROM t1;
-SET debug_dbug='+d,crash_commit_before';
-
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
---error 2013
-ALTER TABLE t1 DROP COLUMN c;
+connect (hang,localhost,root);
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
+send
+ALTER TABLE t1 DROP COLUMN c, FORCE;
---enable_reconnect
---source include/wait_until_connected_again.inc
---disable_reconnect
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+--source include/restart_mysqld.inc
+disconnect hang;
+let $shutdown_timeout=60;
CHECK TABLE t1;
@@ -212,10 +207,4 @@ SELECT CHAR_LENGTH(b) FROM t1;
DROP TABLE t1;
-# Restore global variables
-if ($row_format == 'COMPRESSED')
-{
- SET GLOBAL innodb_file_per_table=default;
-}
-
DROP PROCEDURE populate_t1;
diff --git a/mysql-test/suite/innodb/r/alter_copy.result b/mysql-test/suite/innodb/r/alter_copy.result
index 54b6cdd5ae5..4aece16f0b0 100644
--- a/mysql-test/suite/innodb/r/alter_copy.result
+++ b/mysql-test/suite/innodb/r/alter_copy.result
@@ -37,7 +37,9 @@ t1 CREATE TABLE `t1` (
FULLTEXT KEY `b_2` (`b`,`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
-SET DEBUG_DBUG='+d,crash_commit_before';
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_copy_trans_commit SIGNAL hung WAIT_FOR ever';
+# create 32 secondary indexes
ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX(b,a,d,c),
ADD INDEX(b,d,a,c),ADD INDEX(b,d,c,a),ADD INDEX(a,b,c,d),ADD INDEX(a,b,d,c),
ADD INDEX(a,c,b,d),ADD INDEX(a,c,d,b),ADD INDEX(a,d,b,c),ADD INDEX(a,d,c,b),
@@ -47,8 +49,10 @@ ADD INDEX(d,b,a,c),ADD INDEX(d,b,c,a),ADD INDEX(d,c,a,b),ADD INDEX(d,c,b,a),
ADD INDEX(a,b,c), ADD INDEX(a,c,b), ADD INDEX(a,c,d), ADD INDEX(a,d,c),
ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
ALGORITHM=COPY;
-ERROR HY000: Lost connection to MySQL server during query
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
# restart: --innodb-force-recovery=3
+disconnect hang;
#sql-temporary.frm
#sql-temporary.ibd
FTS_INDEX_1.ibd
diff --git a/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff b/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff
deleted file mode 100644
index 7b4ec54eed8..00000000000
--- a/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff
+++ /dev/null
@@ -1,51 +0,0 @@
---- auto_increment_dup.result
-+++ auto_increment_dup,skip-log-bin.reject
-@@ -89,13 +89,14 @@
- SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
- affected rows: 0
- INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
--ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-+affected rows: 3
-+info: Records: 3 Duplicates: 0 Warnings: 0
- connection con1;
- #
- # 2 duplicates
- #
--affected rows: 3
--info: Records: 3 Duplicates: 0 Warnings: 0
-+affected rows: 4
-+info: Records: 3 Duplicates: 1 Warnings: 0
- connection default;
- #
- # 3 rows
-@@ -103,19 +104,21 @@
- SELECT * FROM t1 order by k;
- id k c
- 1 1 NULL
--2 2 NULL
--3 3 NULL
--affected rows: 3
-+4 2 1
-+2 3 NULL
-+5 4 NULL
-+6 5 NULL
-+affected rows: 5
- INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
--affected rows: 4
--info: Records: 3 Duplicates: 1 Warnings: 0
-+affected rows: 6
-+info: Records: 3 Duplicates: 3 Warnings: 0
- SELECT * FROM t1 order by k;
- id k c
- 1 1 NULL
--2 2 2
--3 3 NULL
--7 4 NULL
--8 5 NULL
-+4 2 2
-+2 3 NULL
-+5 4 2
-+6 5 2
- affected rows: 5
- disconnect con1;
- disconnect con2;
diff --git a/mysql-test/suite/innodb/r/auto_increment_dup.result b/mysql-test/suite/innodb/r/auto_increment_dup.result
index 1467a459fc1..9926047b665 100644
--- a/mysql-test/suite/innodb/r/auto_increment_dup.result
+++ b/mysql-test/suite/innodb/r/auto_increment_dup.result
@@ -89,13 +89,14 @@ affected rows: 0
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
affected rows: 0
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
connection con1;
#
# 2 duplicates
#
-affected rows: 3
-info: Records: 3 Duplicates: 0 Warnings: 0
+affected rows: 4
+info: Records: 3 Duplicates: 1 Warnings: 0
connection default;
#
# 3 rows
@@ -103,19 +104,21 @@ connection default;
SELECT * FROM t1 order by k;
id k c
1 1 NULL
-2 2 NULL
-3 3 NULL
-affected rows: 3
+4 2 1
+2 3 NULL
+5 4 NULL
+6 5 NULL
+affected rows: 5
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
-affected rows: 4
-info: Records: 3 Duplicates: 1 Warnings: 0
+affected rows: 6
+info: Records: 3 Duplicates: 3 Warnings: 0
SELECT * FROM t1 order by k;
id k c
1 1 NULL
-2 2 2
-3 3 NULL
-7 4 NULL
-8 5 NULL
+4 2 2
+2 3 NULL
+5 4 2
+6 5 2
affected rows: 5
disconnect con1;
disconnect con2;
diff --git a/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result b/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result
index cd5a3c340da..295a9f1bed8 100644
--- a/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result
+++ b/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result
@@ -17,21 +17,9 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
10000
CREATE INDEX idx_title ON t1(title);
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-SELECT * FROM t1 WHERE title = 'a10';
-class id title
-10 10 a10
-SELECT * FROM t1 WHERE title = 'a5000';
-class id title
-5000 5000 a5000
-SELECT * FROM t1 WHERE title = 'a10000';
-class id title
-10000 10000 a10000
-SELECT * FROM t1 WHERE title = 'a10010';
-class id title
-DROP TABLE t1;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+RENAME TABLE t1 TO t0;
# Test Blob
CREATE TABLE t1(
a INT PRIMARY KEY,
@@ -48,9 +36,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-ALTER TABLE t1 DROP COLUMN c;
-CHECK TABLE t1;
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+CHECK TABLE t0,t1;
Table Op Msg_type Msg_text
+test.t0 check status OK
test.t1 check status OK
SELECT CHAR_LENGTH(b) FROM t1;
CHAR_LENGTH(b)
@@ -59,14 +50,33 @@ CHAR_LENGTH(b)
40000
60000
DROP TABLE t1;
+RENAME TABLE t0 to t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT * FROM t1 WHERE title = 'a10';
+class id title
+10 10 a10
+SELECT * FROM t1 WHERE title = 'a5000';
+class id title
+5000 5000 a5000
+SELECT * FROM t1 WHERE title = 'a10000';
+class id title
+10000 10000 a10000
+SELECT * FROM t1 WHERE title = 'a10010';
+class id title
+DROP TABLE t1;
CREATE TABLE t1(
class INT,
id INT,
title VARCHAR(100)
) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
-SET debug_dbug='+d,crash_commit_before';
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
CREATE INDEX idx_title ON t1(title);
-ERROR HY000: Lost connection to MySQL server during query
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
SELECT COUNT(*) FROM t1;
COUNT(*)
10000
@@ -104,9 +114,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-SET debug_dbug='+d,crash_commit_before';
-ALTER TABLE t1 DROP COLUMN c;
-ERROR HY000: Lost connection to MySQL server during query
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -137,21 +150,9 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
10000
CREATE INDEX idx_title ON t1(title);
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-SELECT * FROM t1 WHERE title = 'a10';
-class id title
-10 10 a10
-SELECT * FROM t1 WHERE title = 'a5000';
-class id title
-5000 5000 a5000
-SELECT * FROM t1 WHERE title = 'a10000';
-class id title
-10000 10000 a10000
-SELECT * FROM t1 WHERE title = 'a10010';
-class id title
-DROP TABLE t1;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+RENAME TABLE t1 TO t0;
# Test Blob
CREATE TABLE t1(
a INT PRIMARY KEY,
@@ -168,9 +169,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-ALTER TABLE t1 DROP COLUMN c;
-CHECK TABLE t1;
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+CHECK TABLE t0,t1;
Table Op Msg_type Msg_text
+test.t0 check status OK
test.t1 check status OK
SELECT CHAR_LENGTH(b) FROM t1;
CHAR_LENGTH(b)
@@ -179,14 +183,33 @@ CHAR_LENGTH(b)
40000
60000
DROP TABLE t1;
+RENAME TABLE t0 to t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT * FROM t1 WHERE title = 'a10';
+class id title
+10 10 a10
+SELECT * FROM t1 WHERE title = 'a5000';
+class id title
+5000 5000 a5000
+SELECT * FROM t1 WHERE title = 'a10000';
+class id title
+10000 10000 a10000
+SELECT * FROM t1 WHERE title = 'a10010';
+class id title
+DROP TABLE t1;
CREATE TABLE t1(
class INT,
id INT,
title VARCHAR(100)
) ENGINE=InnoDB ROW_FORMAT=COMPACT;
-SET debug_dbug='+d,crash_commit_before';
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
CREATE INDEX idx_title ON t1(title);
-ERROR HY000: Lost connection to MySQL server during query
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
SELECT COUNT(*) FROM t1;
COUNT(*)
10000
@@ -224,9 +247,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-SET debug_dbug='+d,crash_commit_before';
-ALTER TABLE t1 DROP COLUMN c;
-ERROR HY000: Lost connection to MySQL server during query
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -257,21 +283,9 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
10000
CREATE INDEX idx_title ON t1(title);
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-SELECT * FROM t1 WHERE title = 'a10';
-class id title
-10 10 a10
-SELECT * FROM t1 WHERE title = 'a5000';
-class id title
-5000 5000 a5000
-SELECT * FROM t1 WHERE title = 'a10000';
-class id title
-10000 10000 a10000
-SELECT * FROM t1 WHERE title = 'a10010';
-class id title
-DROP TABLE t1;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+RENAME TABLE t1 TO t0;
# Test Blob
CREATE TABLE t1(
a INT PRIMARY KEY,
@@ -288,9 +302,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-ALTER TABLE t1 DROP COLUMN c;
-CHECK TABLE t1;
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+CHECK TABLE t0,t1;
Table Op Msg_type Msg_text
+test.t0 check status OK
test.t1 check status OK
SELECT CHAR_LENGTH(b) FROM t1;
CHAR_LENGTH(b)
@@ -299,14 +316,33 @@ CHAR_LENGTH(b)
40000
60000
DROP TABLE t1;
+RENAME TABLE t0 to t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT * FROM t1 WHERE title = 'a10';
+class id title
+10 10 a10
+SELECT * FROM t1 WHERE title = 'a5000';
+class id title
+5000 5000 a5000
+SELECT * FROM t1 WHERE title = 'a10000';
+class id title
+10000 10000 a10000
+SELECT * FROM t1 WHERE title = 'a10010';
+class id title
+DROP TABLE t1;
CREATE TABLE t1(
class INT,
id INT,
title VARCHAR(100)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-SET debug_dbug='+d,crash_commit_before';
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
CREATE INDEX idx_title ON t1(title);
-ERROR HY000: Lost connection to MySQL server during query
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
SELECT COUNT(*) FROM t1;
COUNT(*)
10000
@@ -344,9 +380,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-SET debug_dbug='+d,crash_commit_before';
-ALTER TABLE t1 DROP COLUMN c;
-ERROR HY000: Lost connection to MySQL server during query
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -378,21 +417,9 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
10000
CREATE INDEX idx_title ON t1(title);
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-SELECT * FROM t1 WHERE title = 'a10';
-class id title
-10 10 a10
-SELECT * FROM t1 WHERE title = 'a5000';
-class id title
-5000 5000 a5000
-SELECT * FROM t1 WHERE title = 'a10000';
-class id title
-10000 10000 a10000
-SELECT * FROM t1 WHERE title = 'a10010';
-class id title
-DROP TABLE t1;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+RENAME TABLE t1 TO t0;
# Test Blob
SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
@@ -410,9 +437,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-ALTER TABLE t1 DROP COLUMN c;
-CHECK TABLE t1;
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+CHECK TABLE t0,t1;
Table Op Msg_type Msg_text
+test.t0 check status OK
test.t1 check status OK
SELECT CHAR_LENGTH(b) FROM t1;
CHAR_LENGTH(b)
@@ -421,15 +451,34 @@ CHAR_LENGTH(b)
40000
60000
DROP TABLE t1;
+RENAME TABLE t0 to t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT * FROM t1 WHERE title = 'a10';
+class id title
+10 10 a10
+SELECT * FROM t1 WHERE title = 'a5000';
+class id title
+5000 5000 a5000
+SELECT * FROM t1 WHERE title = 'a10000';
+class id title
+10000 10000 a10000
+SELECT * FROM t1 WHERE title = 'a10010';
+class id title
+DROP TABLE t1;
SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
class INT,
id INT,
title VARCHAR(100)
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
-SET debug_dbug='+d,crash_commit_before';
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
CREATE INDEX idx_title ON t1(title);
-ERROR HY000: Lost connection to MySQL server during query
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
SELECT COUNT(*) FROM t1;
COUNT(*)
10000
@@ -468,9 +517,12 @@ CHAR_LENGTH(b)
20000
40000
60000
-SET debug_dbug='+d,crash_commit_before';
-ALTER TABLE t1 DROP COLUMN c;
-ERROR HY000: Lost connection to MySQL server during query
+connect hang,localhost,root;
+SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t1 DROP COLUMN c, FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+disconnect hang;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -481,5 +533,4 @@ CHAR_LENGTH(b)
40000
60000
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=default;
DROP PROCEDURE populate_t1;
diff --git a/mysql-test/suite/innodb/r/trx_id_future.result b/mysql-test/suite/innodb/r/trx_id_future.result
index 887d11ddcc2..17b76b4b1c1 100644
--- a/mysql-test/suite/innodb/r/trx_id_future.result
+++ b/mysql-test/suite/innodb/r/trx_id_future.result
@@ -2,8 +2,10 @@
# Bug #20445525 ADD A CONSISTENCY CHECK AGAINST DB_TRX_ID BEING
# IN THE FUTURE
#
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
CREATE TABLE t1(a INT) row_format=redundant engine=innoDB;
INSERT INTO t1 VALUES(1);
+InnoDB 0 transactions not purged
NOT FOUND /\[Warning\] InnoDB: A transaction id in a record of table `test`\.`t1` is newer than the system-wide maximum/ in mysqld.1.err
call mtr.add_suppression("\\[Warning\\] InnoDB: A transaction id in a record of table `test`\\.`t1` is newer than the system-wide maximum");
SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/t/alter_copy.test b/mysql-test/suite/innodb/t/alter_copy.test
index 0dce61994b5..b7ab05a061a 100644
--- a/mysql-test/suite/innodb/t/alter_copy.test
+++ b/mysql-test/suite/innodb/t/alter_copy.test
@@ -37,11 +37,11 @@ SELECT * FROM t1 WHERE MATCH(b,c) AGAINST ('column');
SHOW CREATE TABLE t1;
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
-# crash right after the last write_row(), before the first commit of ALTER TABLE
---source include/expect_crash.inc
+# kill right after the last write_row(), before the first commit of ALTER TABLE
+connect (hang,localhost,root);
-SET DEBUG_DBUG='+d,crash_commit_before';
---error 2013
+SET DEBUG_SYNC='alter_table_copy_trans_commit SIGNAL hung WAIT_FOR ever';
+send
# create 32 secondary indexes
ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX(b,a,d,c),
ADD INDEX(b,d,a,c),ADD INDEX(b,d,c,a),ADD INDEX(a,b,c,d),ADD INDEX(a,b,d,c),
@@ -53,8 +53,13 @@ ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX
ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
ALGORITHM=COPY;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+let $shutdown_timeout=0;
--let $restart_parameters= --innodb-force-recovery=3
---source include/start_mysqld.inc
+--source include/restart_mysqld.inc
+disconnect hang;
+let $shutdown_timeout=;
let $datadir=`select @@datadir`;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
--list_files $datadir/test
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test
index aa399e5966d..9e54a6a8a66 100644
--- a/mysql-test/suite/innodb/t/auto_increment_dup.test
+++ b/mysql-test/suite/innodb/t/auto_increment_dup.test
@@ -8,8 +8,6 @@
--source include/have_debug_sync.inc
--source include/innodb_binlog.inc
-let $stmt= `SELECT @@GLOBAL.log_bin`;
-
set global transaction isolation level repeatable read;
CREATE TABLE t1(
@@ -84,13 +82,7 @@ SET DEBUG_SYNC='ha_write_row_end SIGNAL write_row_done WAIT_FOR continue';
--reap
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
-if ($stmt) {
---error ER_LOCK_WAIT_TIMEOUT
-INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
-}
-if (!$stmt) {
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
-}
--connection con1
--echo #
diff --git a/mysql-test/suite/innodb/t/trx_id_future.test b/mysql-test/suite/innodb/t/trx_id_future.test
index b73678abc4c..391650c13d4 100644
--- a/mysql-test/suite/innodb/t/trx_id_future.test
+++ b/mysql-test/suite/innodb/t/trx_id_future.test
@@ -7,14 +7,15 @@
--source include/have_innodb.inc
--source include/not_embedded.inc
+SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
let PAGE_SIZE=`select @@innodb_page_size`;
CREATE TABLE t1(a INT) row_format=redundant engine=innoDB;
INSERT INTO t1 VALUES(1);
let MYSQLD_DATADIR=`select @@datadir`;
+--source include/wait_all_purged.inc
let $restart_noprint=2;
-
--source include/shutdown_mysqld.inc
perl;
diff --git a/mysql-test/suite/mariabackup/big_innodb_log.result b/mysql-test/suite/mariabackup/big_innodb_log.result
new file mode 100644
index 00000000000..7bd5d20049d
--- /dev/null
+++ b/mysql-test/suite/mariabackup/big_innodb_log.result
@@ -0,0 +1,32 @@
+# Kill the server
+# restart: --debug-dbug=+d,innodb_small_log_block_no_limit
+CREATE TABLE t(i INT) ENGINE InnoDB;
+INSERT INTO t VALUES
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+# xtrabackup backup, execute the following query after test.t is copied:
+# BEGIN NOT ATOMIC INSERT INTO test.t SELECT * FROM test.t; UPDATE test.t SET i = 10 WHERE i = 0; DELETE FROM test.t WHERE i = 1; END
+SELECT count(*) FROM t WHERE i = 0;
+count(*)
+0
+# xtrabackup prepare
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart: --debug-dbug=+d,innodb_small_log_block_no_limit
+SELECT count(*) FROM t WHERE i = 0;
+count(*)
+0
+Ok
+Ok
+DROP TABLE t;
+# Kill the server
+# restart
diff --git a/mysql-test/suite/mariabackup/big_innodb_log.test b/mysql-test/suite/mariabackup/big_innodb_log.test
new file mode 100644
index 00000000000..05dc3aa39c5
--- /dev/null
+++ b/mysql-test/suite/mariabackup/big_innodb_log.test
@@ -0,0 +1,87 @@
+# The general reason why innodb redo log file is limited by 512G is that
+# log_block_convert_lsn_to_no() returns value limited by 1G. But there is no
+# need to have unique log block numbers in log group. This test forces innodb
+# to generate redo log files with non-unique log block numbers and tests
+# recovery process with such numbers.
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+--let MYSQLD_DATADIR= `select @@datadir`
+let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --debug-dbug=+d,innodb_small_log_block_no_limit;
+
+--source include/kill_mysqld.inc
+--rmdir $MYSQLD_DATADIR
+--mkdir $MYSQLD_DATADIR
+--mkdir $MYSQLD_DATADIR/mysql
+--mkdir $MYSQLD_DATADIR/test
+--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQL_BOOTSTRAP_SQL_FILE >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+let $old_restart_parameters=$restart_parameters;
+let $restart_parameters= $old_restart_parameters --debug-dbug=+d,innodb_small_log_block_no_limit;
+--source include/start_mysqld.inc
+
+CREATE TABLE t(i INT) ENGINE InnoDB;
+INSERT INTO t VALUES
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+
+--let after_copy_test_t=BEGIN NOT ATOMIC INSERT INTO test.t SELECT * FROM test.t; UPDATE test.t SET i = 10 WHERE i = 0; DELETE FROM test.t WHERE i = 1; END
+
+--echo # xtrabackup backup, execute the following query after test.t is copied:
+--echo # $after_copy_test_t
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events,innodb_small_log_block_no_limit;
+--enable_result_log
+
+--let $total_before=`SELECT count(*) FROM t`
+SELECT count(*) FROM t WHERE i = 0;
+--let $updated_before=`SELECT count(*) FROM t WHERE i = 10`
+
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir --dbug=+d,innodb_small_log_block_no_limit;
+--source include/restart_and_restore.inc
+--enable_result_log
+
+--let $total_after=`SELECT count(*) FROM t`
+SELECT count(*) FROM t WHERE i = 0;
+--let $updated_after=`SELECT count(*) FROM t WHERE i = 10`
+
+if ($total_before == $total_after) {
+--echo Ok
+}
+if ($total_before != $total_after) {
+--echo Failed
+}
+if ($updated_before == $updated_after) {
+--echo Ok
+}
+if ($updated_before != $updated_after) {
+--echo Failed
+}
+
+DROP TABLE t;
+rmdir $targetdir;
+--source include/kill_mysqld.inc
+--rmdir $MYSQLD_DATADIR
+
+perl;
+use lib "lib";
+use My::File::Path;
+my $install_db_dir = ($ENV{MTR_PARALLEL} == 1) ?
+ "$ENV{'MYSQLTEST_VARDIR'}/install.db" :
+ "$ENV{'MYSQLTEST_VARDIR'}/../install.db";
+copytree($install_db_dir, $ENV{'MYSQLD_DATADIR'});
+EOF
+
+--let $restart_parameters= $old_restart_parameters
+--source include/start_mysqld.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result b/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result
new file mode 100644
index 00000000000..5cb2cd36d02
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result
@@ -0,0 +1,20 @@
+include/master-slave.inc
+[connection master]
+CREATE TEMPORARY TABLE t1 (a INT NOT NULL);
+LOAD DATA INFILE 'x' INTO TABLE x;
+ERROR 42S02: Table 'test.x' doesn't exist
+CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x);
+ERROR HY000: Cannot create temporary table with partitions
+"************** DROP TEMPORARY TABLE Should be present in Binary log **************"
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1 (a INT NOT NULL)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x)
+CREATE TABLE t1 (b INT);
+INSERT INTO t1 VALUES (NULL);
+connection slave;
+connection master;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result b/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result
index 75a22b78a32..74648501fbe 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result
@@ -41,7 +41,7 @@ START SLAVE;
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
...==== BEGIN include/wait_for_slave_param.inc [Slave_IO_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
-Waiting until 'Slave_IO_Running' = 'Yes' [timeout='300', $slave_error_param='Last_IO_Errno']
+Waiting until 'Slave_IO_Running' = 'Yes' [$slave_error_param='Last_IO_Errno']
[connection slave]
...==== END include/wait_for_slave_param.inc [Slave_IO_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
@@ -52,7 +52,7 @@ Waiting until 'Slave_IO_Running' = 'Yes' [timeout='300', $slave_error_param='Las
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
...==== BEGIN include/wait_for_slave_param.inc [Slave_SQL_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
-Waiting until 'Slave_SQL_Running' = 'Yes' [timeout='300', $slave_error_param='1']
+Waiting until 'Slave_SQL_Running' = 'Yes' [$slave_error_param='1']
[connection slave]
...==== END include/wait_for_slave_param.inc [Slave_SQL_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index 3cbb590b9a7..e935f8083c8 100644
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -1,31 +1,5 @@
call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
include/master-slave.inc
-[connection master]
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
-UNIQUE(b));
-connection slave;
-connection master;
-INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
-SELECT * FROM t1;
-a b
-1 10
-2 2
-connection slave;
-call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
-include/wait_for_slave_sql_error.inc [errno=1105]
-Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10''
-SELECT * FROM t1;
-a b
-stop slave;
-include/wait_for_slave_to_stop.inc
-reset slave;
-connection master;
-reset master;
-drop table t1;
-connection slave;
-start slave;
-include/wait_for_slave_to_start.inc
connection master;
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
diff --git a/mysql-test/suite/rpl/r/rpl_mdev_17614.result b/mysql-test/suite/rpl/r/rpl_mdev_17614.result
new file mode 100644
index 00000000000..39057334926
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_mdev_17614.result
@@ -0,0 +1,129 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY , b INT,
+UNIQUE(b), c int) engine=innodb;
+connection slave;
+connection master;
+INSERT INTO t1 VALUES (1, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
+connection master1;
+INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
+connection master;
+COMMIT;
+SELECT * FROM t1;
+a b c
+1 1 2
+2 2 3
+connection slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+Last_SQL_Error = 'Error 'Duplicate entry '1' for key 'b'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c)''
+#Different value from server
+SELECT * FROM t1;
+a b c
+1 1 1
+2 2 3
+stop slave;
+include/wait_for_slave_to_stop.inc
+reset slave;
+connection master;
+reset master;
+drop table t1;
+connection slave;
+start slave;
+include/wait_for_slave_to_start.inc
+connection master;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
+UNIQUE(b), c int) engine=innodb;
+connection slave;
+connection master;
+INSERT INTO t1 VALUES (default, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (default, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+connection master1;
+INSERT INTO t1 VALUES(default, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+connection master;
+COMMIT;
+SELECT * FROM t1;
+a b c
+1 1 2
+3 2 3
+connection slave;
+#same data as master
+SELECT * FROM t1;
+a b c
+1 1 2
+3 2 3
+connection master;
+drop table t1;
+connection slave;
+connection master;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT,
+UNIQUE(b), c int, d int ) engine=innodb;
+connection slave;
+connection master;
+INSERT INTO t1 VALUES (1, 1, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (2, NULL, 2, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
+connection master1;
+INSERT INTO t1 VALUES(3, NULL, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
+connection master;
+COMMIT;
+SELECT * FROM t1;
+a b c d
+1 1 1 1
+2 NULL 2 2
+3 NULL 2 3
+connection slave;
+#same data as master
+SELECT * FROM t1;
+a b c d
+1 1 1 1
+2 NULL 2 2
+3 NULL 2 3
+connection master;
+drop table t1;
+connection slave;
+connection master;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
+UNIQUE(b), c int) engine=innodb;
+connection slave;
+connection master;
+INSERT INTO t1 VALUES (1, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+connection master1;
+INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+connection master;
+COMMIT;
+SELECT * FROM t1;
+a b c
+1 1 2
+2 2 3
+connection slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+Last_SQL_Error = 'Error 'Duplicate entry '1' for key 'b'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c)''
+#Different value from server
+SELECT * FROM t1;
+a b c
+1 1 1
+2 2 3
+stop slave;
+include/wait_for_slave_to_stop.inc
+reset slave;
+connection master;
+reset master;
+drop table t1;
+connection slave;
+start slave;
+include/wait_for_slave_to_start.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
new file mode 100644
index 00000000000..cd9ac1db9b1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
@@ -0,0 +1,18 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency;
+SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
+SET GLOBAL innodb_thread_concurrency = 100;
+connection master;
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+connection slave;
+include/diff_tables.inc [master:t, slave:t]
+"===== Clean up======="
+connection master;
+DROP TABLE t;
+connection slave;
+SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
+SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_unsafe_statements.result b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
index ca790f5d148..0ce94ca63d0 100644
--- a/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
+++ b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TRIGGER trig1 AFTER INSERT ON t1
@@ -49,9 +50,13 @@ connection master;
DROP TABLE t1;
CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
START TRANSACTION;
LOCK TABLES t1 WRITE;
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
UNLOCK TABLES;
COMMIT;
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test b/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test
new file mode 100644
index 00000000000..e75f34b0b56
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test
@@ -0,0 +1,56 @@
+# ==== Purpose ====
+#
+# Test verifies that failed CREATE OR REPLACE TEMPORARY TABLE statement which
+# dropped the table but failed at a later stage of creation of temporary table
+# is written to binarylog in row based replication.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Have mixed based replication mode.
+# 1 - Create a temporary table. It will be replicated as mixed replication
+# mode is in use.
+# 2 - Execute an unsafe statement which will switch current statement
+# binlog format to 'ROW'. i.e If binlog_format=MIXED, there are open
+# temporary tables, and an unsafe statement is executed, then subsequent
+# statements are logged in row format.
+# 3 - Execute a CREATE OR REPLACE TEMPORARY TABLE statement which tries to
+# create partitions on temporary table. Since it is not supported it will
+# fail.
+# 4 - Check the binary log output to ensure that the failed statement is
+# written to the binary log.
+# 5 - Slave should be up and running and in sync with master.
+#
+# ==== References ====
+#
+# MDEV-18930: Failed CREATE OR REPLACE TEMPORARY not written into binary log
+# makes data on master and slave diverge
+#
+
+--source include/have_partition.inc
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+CREATE TEMPORARY TABLE t1 (a INT NOT NULL);
+
+# Execute an unsafe statement which switches replication mode internally from
+# "STATEMENT" to "ROW".
+--error ER_NO_SUCH_TABLE
+LOAD DATA INFILE 'x' INTO TABLE x;
+
+--error ER_PARTITION_NO_TEMPORARY
+CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x);
+
+--echo "************** DROP TEMPORARY TABLE Should be present in Binary log **************"
+--source include/show_binlog_events.inc
+
+CREATE TABLE t1 (b INT);
+INSERT INTO t1 VALUES (NULL);
+--sync_slave_with_master
+
+# Cleanup
+--connection master
+DROP TABLE t1;
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
index ab263ece407..5ea056d5f14 100644
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
@@ -14,45 +14,6 @@ source include/have_binlog_checksum_off.inc;
source include/master-slave.inc;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
-
-#
-# This is to test that slave properly detects if
-# master may suffer from:
-# BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
-# (i.e. on master, INSERT ON DUPLICATE KEY UPDATE is used and manipulates
-# an auto_increment column, and is binlogged statement-based).
-#
-
-# testcase with INSERT VALUES
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
-UNIQUE(b));
-sync_slave_with_master;
-connection master;
-INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
-SELECT * FROM t1;
-connection slave;
-
-# show the error message
-#1105 = ER_UNKNOWN_ERROR
---let $slave_sql_errno= 1105
---let $show_slave_sql_error= 1
-call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
---source include/wait_for_slave_sql_error.inc
-# show that it was not replicated
-SELECT * FROM t1;
-
-# restart replication for the next testcase
-stop slave;
---source include/wait_for_slave_to_stop.inc
-reset slave;
-connection master;
-reset master;
-drop table t1;
-connection slave;
-start slave;
---source include/wait_for_slave_to_start.inc
-
# testcase with INSERT SELECT
connection master;
CREATE TABLE t1 (
diff --git a/mysql-test/suite/rpl/t/rpl_mdev_17614.test b/mysql-test/suite/rpl/t/rpl_mdev_17614.test
new file mode 100644
index 00000000000..9b86c8c15b5
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_mdev_17614.test
@@ -0,0 +1,121 @@
+source include/have_debug.inc;
+source include/have_innodb.inc;
+-- source include/have_binlog_format_statement.inc
+source include/master-slave.inc;
+# MDEV-17614
+# INSERT on dup key update is replication unsafe
+# There can be three case
+# 1. 2 unique key, Replication is unsafe.
+# 2. 2 unique key , with one auto increment key, Safe to replicate because Innodb will acquire gap lock
+# 3. n no of unique keys (n>1) but insert is only in 1 unique key
+# 4. 2 unique key , with one auto increment key(but user gives auto inc value), unsafe to replicate
+
+# Case 1
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY , b INT,
+UNIQUE(b), c int) engine=innodb;
+sync_slave_with_master;
+connection master;
+INSERT INTO t1 VALUES (1, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+ --connection master1
+ INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+--connection master
+COMMIT;
+SELECT * FROM t1;
+--connection slave
+# show the error message
+--let $slave_sql_errno= 1062
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+--echo #Different value from server
+SELECT * FROM t1;
+
+# restart replication for the next testcase
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+reset slave;
+connection master;
+reset master;
+drop table t1;
+connection slave;
+start slave;
+--source include/wait_for_slave_to_start.inc
+# Case 2
+--connection master
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
+UNIQUE(b), c int) engine=innodb;
+sync_slave_with_master;
+connection master;
+INSERT INTO t1 VALUES (default, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (default, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+ --connection master1
+ INSERT INTO t1 VALUES(default, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+--connection master
+COMMIT;
+SELECT * FROM t1;
+--sync_slave_with_master
+--echo #same data as master
+SELECT * FROM t1;
+
+connection master;
+drop table t1;
+--sync_slave_with_master
+
+# Case 3
+--connection master
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT,
+UNIQUE(b), c int, d int ) engine=innodb;
+sync_slave_with_master;
+connection master;
+INSERT INTO t1 VALUES (1, 1, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (2, NULL, 2, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+ --connection master1
+ INSERT INTO t1 VALUES(3, NULL, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+--connection master
+COMMIT;
+SELECT * FROM t1;
+--sync_slave_with_master
+--echo #same data as master
+SELECT * FROM t1;
+connection master;
+drop table t1;
+--sync_slave_with_master
+
+# Case 4
+--connection master
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
+UNIQUE(b), c int) engine=innodb;
+sync_slave_with_master;
+connection master;
+INSERT INTO t1 VALUES (1, 1, 1);
+BEGIN;
+INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+ --connection master1
+ INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
+--connection master
+COMMIT;
+SELECT * FROM t1;
+--connection slave
+# show the error message
+--let $slave_sql_errno= 1062
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+--echo #Different value from server
+SELECT * FROM t1;
+
+# restart replication for the next testcase
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+reset slave;
+connection master;
+reset master;
+drop table t1;
+connection slave;
+start slave;
+--source include/wait_for_slave_to_start.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
new file mode 100644
index 00000000000..b4c2971d2fb
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
@@ -0,0 +1,41 @@
+# ==== Purpose ====
+#
+# Test verifies that replication shouldn't hang when number of active threads
+# on the slave server are less than the allowed innodb_thread_concurrency value.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Have master slave replication setup with engine being Innodb.
+# 1 - Configure innodb_thread_concurrency = 100.
+# 2 - Do some DML on master and sync the slave with master.
+# 3 - Ensure replication doesn't hang.
+#
+# ==== References ====
+#
+# MDEV-20247: Replication hangs with "preparing" and never starts
+#
+
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+--connection slave
+SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency;
+SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
+SET GLOBAL innodb_thread_concurrency = 100;
+
+--connection master
+CREATE TABLE t(f INT) ENGINE=INNODB;
+INSERT INTO t VALUES (10);
+--sync_slave_with_master
+
+--let $diff_tables=master:t, slave:t
+--source include/diff_tables.inc
+
+--echo "===== Clean up======="
+--connection master
+DROP TABLE t;
+--sync_slave_with_master
+SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
+SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_unsafe_statements.test b/mysql-test/suite/rpl/t/rpl_unsafe_statements.test
index cbb4b54a220..aa0bd076398 100644
--- a/mysql-test/suite/rpl/t/rpl_unsafe_statements.test
+++ b/mysql-test/suite/rpl/t/rpl_unsafe_statements.test
@@ -24,7 +24,7 @@
--source include/have_innodb.inc
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
-
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
# Case-1: BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS
# Statement is unsafe because it invokes a trigger or a
# stored function that inserts into an AUTO_INCREMENT column.
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 6a377eb2a1d..3562d016266 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -1473,7 +1473,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of each log file in a log group.
NUMERIC_MIN_VALUE 1048576
-NUMERIC_MAX_VALUE 549755813888
+NUMERIC_MAX_VALUE 17592186044415
NUMERIC_BLOCK_SIZE 65536
ENUM_VALUE_LIST NULL
READ_ONLY YES
diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
index 2130723e5ff..2d8e9005f81 100644
--- a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
+++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result
@@ -1,18 +1,9 @@
SET @start_value = @@global.table_open_cache ;
-SELECT @start_value;
-@start_value
-421
-'#--------------------FN_DYNVARS_001_01------------------------#'
-SET @@global.table_open_cache = 99;
-SET @@global.table_open_cache = DeFAULT;
-SELECT @@global.table_open_cache;
-@@global.table_open_cache
-2000
'#---------------------FN_DYNVARS_001_02-------------------------#'
SET @@global.table_open_cache = Default;
-SELECT @@global.table_open_cache = 400;
-@@global.table_open_cache = 400
-0
+SELECT @@global.table_open_cache > 0;
+@@global.table_open_cache > 0
+1
'#--------------------FN_DYNVARS_001_03------------------------#'
SET @@global.table_open_cache = 8;
Warnings:
@@ -106,6 +97,3 @@ ERROR 42S02: Unknown table 'global' in field list
SELECT table_open_cache = @@session.table_open_cache ;
ERROR 42S22: Unknown column 'table_open_cache' in 'field list'
SET @@global.table_open_cache = @start_value;
-SELECT @@global.table_open_cache ;
-@@global.table_open_cache
-421
diff --git a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
index d2450e9586e..fc838d1a28b 100644
--- a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
+++ b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test
@@ -4,8 +4,8 @@
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
-# Default Value: 400 #
-# Range: 64-524288 #
+# Default Value: 400 #
+# Range: 64-524288 #
# #
# #
# Creation Date: 2008-02-13 #
@@ -35,18 +35,6 @@
##########################################################################
SET @start_value = @@global.table_open_cache ;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_001_01------------------------#'
-########################################################################
-# Display the DEFAULT value of table_open_cache #
-########################################################################
-
-SET @@global.table_open_cache = 99;
-SET @@global.table_open_cache = DeFAULT;
-SELECT @@global.table_open_cache;
-
--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
###############################################
@@ -54,7 +42,7 @@ SELECT @@global.table_open_cache;
###############################################
SET @@global.table_open_cache = Default;
-SELECT @@global.table_open_cache = 400;
+SELECT @@global.table_open_cache > 0;
--echo '#--------------------FN_DYNVARS_001_03------------------------#'
########################################################################
@@ -163,10 +151,7 @@ SELECT table_open_cache = @@session.table_open_cache ;
##############################
SET @@global.table_open_cache = @start_value;
-SELECT @@global.table_open_cache ;
-
##################################################################
# END OF table_open_cache TESTS #
##################################################################
-
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index c82a4d123c4..51a0e7c5beb 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -605,5 +605,40 @@ select * from t1;
a b
1 0
affected rows: 1
+#
+# MDEV-19304 Segfault in ALTER TABLE after UPDATE for SIMULTANEOUS_ASSIGNMENT
+#
+create or replace table t1 (a int, s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) engine=myisam with system versioning;
+insert into t1 values (null, null, null);
+insert into t1 values (null, null, null);
+set sql_mode= 'simultaneous_assignment';
+update t1 set e= 1;
+Warnings:
+Warning 1906 The value specified for generated column 'e' in table 't1' has been ignored
+Warning 1906 The value specified for generated column 'e' in table 't1' has been ignored
+alter table t1 force;
+set sql_mode= default;
+#
+# MDEV-18862 Unfortunate error message upon attempt to drop system versioning
+#
+set system_versioning_alter_history= keep;
+create or replace table t1 (x int) with system versioning;
+alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
+ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
+alter table t1 drop period for system_time;
+ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
+alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
+ERROR 42000: Can't DROP COLUMN `row_start`; check that it exists
+alter table t1 drop column `row_end`;
+ERROR 42000: Can't DROP COLUMN `row_end`; check that it exists
+#
+# MDEV-19127 Assertion `row_start_field' failed in vers_prepare_keys upon ALTER TABLE
+#
+set system_versioning_alter_history=keep;
+create or replace table t1 (f1 int) with system versioning;
+alter table t1 add f2 int with system versioning, drop system versioning;
+create or replace table t1 (f1 int) with system versioning;
+alter table t1 drop system versioning, add f2 int with system versioning;
+ERROR HY000: Table `t1` is not system-versioned
drop database test;
create database test;
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 3f2b06b3acb..9e532824414 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -554,6 +554,36 @@ t1 CREATE TABLE `t1` (
#
create or replace table t1 (f int) with system versioning partition by hash(f);
insert delayed into t1 values (1);
+#
+# MDEV-17613 MIN/MAX Optimization (Select tables optimized away) does not work
+#
+create or replace table t1 (pk int primary key) with system versioning
+partition by system_time (
+partition p1 history,
+partition pn current);
+insert into t1 values (1), (2);
+explain select max(pk) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+#
+# MDEV-20068 History partition rotation is not done under LOCK TABLES
+#
+create or replace table t1 (x int) with system versioning partition by system_time limit 1
+(partition p1 history, partition pn current);
+lock tables t1 write;
+insert into t1 values (0), (1), (2), (3);
+delete from t1 where x < 3;
+delete from t1;
+Warnings:
+Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
+unlock tables;
+#
+# MDEV-20336 Assertion bitmap_is_set(read_partitions) upon SELECT FOR UPDATE from versioned table
+#
+create or replace table t1 (pk int primary key) with system versioning partition by system_time limit 100 (partition p1 history, partition pn current);
+execute immediate 'select * from t1 for update';
+pk
+drop table t1;
# Test cleanup
drop database test;
create database test;
diff --git a/mysql-test/suite/versioning/r/partition_rotation.result b/mysql-test/suite/versioning/r/partition_rotation.result
index 7e25f122238..69b30a56bd6 100644
--- a/mysql-test/suite/versioning/r/partition_rotation.result
+++ b/mysql-test/suite/versioning/r/partition_rotation.result
@@ -44,7 +44,7 @@ i
6
explain partitions select * from t1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 2
explain partitions select * from t1 for system_time as of '2001-02-04 10:20:30';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1_p1sp0,p1_p1sp1,p0_p0sp0,p0_p0sp1,p2_p2sp0,p2_p2sp1,pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL # Using where
diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test
index 272c8ed0f74..2874cda51cb 100644
--- a/mysql-test/suite/versioning/t/alter.test
+++ b/mysql-test/suite/versioning/t/alter.test
@@ -503,5 +503,40 @@ alter table t1 modify a int with system versioning;
select * from t1;
--disable_info
+--echo #
+--echo # MDEV-19304 Segfault in ALTER TABLE after UPDATE for SIMULTANEOUS_ASSIGNMENT
+--echo #
+create or replace table t1 (a int, s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) engine=myisam with system versioning;
+insert into t1 values (null, null, null);
+insert into t1 values (null, null, null);
+set sql_mode= 'simultaneous_assignment';
+update t1 set e= 1;
+alter table t1 force;
+set sql_mode= default;
+
+--echo #
+--echo # MDEV-18862 Unfortunate error message upon attempt to drop system versioning
+--echo #
+set system_versioning_alter_history= keep;
+create or replace table t1 (x int) with system versioning;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop period for system_time;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
+--error ER_CANT_DROP_FIELD_OR_KEY
+alter table t1 drop column `row_end`;
+
+--echo #
+--echo # MDEV-19127 Assertion `row_start_field' failed in vers_prepare_keys upon ALTER TABLE
+--echo #
+set system_versioning_alter_history=keep;
+create or replace table t1 (f1 int) with system versioning;
+alter table t1 add f2 int with system versioning, drop system versioning;
+create or replace table t1 (f1 int) with system versioning;
+--error ER_VERS_NOT_VERSIONED
+alter table t1 drop system versioning, add f2 int with system versioning;
+
drop database test;
create database test;
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 76c2556bcda..ac9b0de690a 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -488,6 +488,45 @@ create or replace table t1 (f int) with system versioning partition by hash(f);
--error 0,ER_DELAYED_NOT_SUPPORTED
insert delayed into t1 values (1);
+--echo #
+--echo # MDEV-17613 MIN/MAX Optimization (Select tables optimized away) does not work
+--echo #
+--disable_query_log
+set @saved_storage_engine= @@default_storage_engine;
+if ($MTR_COMBINATION_HEAP)
+{
+ # This case does not work with HEAP
+ set default_storage_engine= myisam;
+}
+--enable_query_log
+create or replace table t1 (pk int primary key) with system versioning
+partition by system_time (
+ partition p1 history,
+ partition pn current);
+insert into t1 values (1), (2);
+explain select max(pk) from t1;
+--disable_query_log
+set default_storage_engine= @saved_storage_engine;
+--enable_query_log
+
+--echo #
+--echo # MDEV-20068 History partition rotation is not done under LOCK TABLES
+--echo #
+create or replace table t1 (x int) with system versioning partition by system_time limit 1
+(partition p1 history, partition pn current);
+lock tables t1 write;
+insert into t1 values (0), (1), (2), (3);
+delete from t1 where x < 3;
+delete from t1;
+unlock tables;
+
+--echo #
+--echo # MDEV-20336 Assertion bitmap_is_set(read_partitions) upon SELECT FOR UPDATE from versioned table
+--echo #
+create or replace table t1 (pk int primary key) with system versioning partition by system_time limit 100 (partition p1 history, partition pn current);
+execute immediate 'select * from t1 for update';
+drop table t1;
+
--echo # Test cleanup
drop database test;
create database test;