summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-05-29 17:34:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-05-29 17:34:49 +0300
commita3539bbb2ac51dfa2b363d3b4c11784c25d1f256 (patch)
tree6b49da1f15e5740adaf5da1c4179760a15b77dc4 /mysql-test
parentc98e6d4b3d4d17ee429c696ac07e0bc4bbe1a81e (diff)
parent6f96ff7268dd20d6d3b61931c972e7a43c1efdff (diff)
downloadmariadb-git-a3539bbb2ac51dfa2b363d3b4c11784c25d1f256.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/alter_table.result60
-rw-r--r--mysql-test/main/alter_table.test31
-rw-r--r--mysql-test/main/grant2.result3
-rw-r--r--mysql-test/main/grant2.test3
-rw-r--r--mysql-test/main/rename.result66
-rw-r--r--mysql-test/main/rename.test46
-rw-r--r--mysql-test/main/statistics_close.result11
-rw-r--r--mysql-test/main/statistics_close.test18
-rw-r--r--mysql-test/main/trigger.result13
-rw-r--r--mysql-test/main/trigger.test14
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master.test1
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_slave.test1
-rw-r--r--mysql-test/suite/binlog_encryption/testdata.opt1
-rw-r--r--mysql-test/suite/galera/r/galera_encrypt_tmp_files.result37
-rw-r--r--mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf8
-rw-r--r--mysql-test/suite/galera/t/galera_encrypt_tmp_files.test57
-rw-r--r--mysql-test/suite/galera/t/galera_var_dirty_reads.test1
-rw-r--r--mysql-test/suite/maria/lock.result11
-rw-r--r--mysql-test/suite/maria/lock.test14
-rw-r--r--mysql-test/suite/mariabackup/lock_ddl_per_table.opt1
-rw-r--r--mysql-test/suite/mariabackup/lock_ddl_per_table.test1
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.opt1
-rw-r--r--mysql-test/suite/mariabackup/partition_datadir.test1
-rw-r--r--mysql-test/suite/mariabackup/suite.opt2
-rw-r--r--mysql-test/suite/perfschema/r/partition.result10
-rw-r--r--mysql-test/suite/perfschema/t/partition.test16
-rw-r--r--mysql-test/suite/rpl/r/rename.result36
-rw-r--r--mysql-test/suite/rpl/t/rename.test33
-rw-r--r--mysql-test/suite/vcol/r/binlog.result70
-rw-r--r--mysql-test/suite/vcol/r/update_binlog.result361
-rw-r--r--mysql-test/suite/vcol/t/binlog.test55
-rw-r--r--mysql-test/suite/vcol/t/update_binlog.test14
32 files changed, 988 insertions, 9 deletions
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 5f41e0d7a08..cb5553a086c 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -2175,6 +2175,66 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE t1;
#
+# MDEV-15308
+# Assertion `ha_alter_info->alter_info->drop_list.elements > 0' failed
+# in ha_innodb::prepare_inplace_alter_table
+#
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN b;
+Warnings:
+Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN b;
+Warnings:
+Note 1091 Can't DROP INDEX `fk`; check that it exists
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, c INT, KEY(c)) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN c;
+Warnings:
+Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, c INT, KEY c1(c)) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP INDEX c1;
+Warnings:
+Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN IF EXISTS c;
+Warnings:
+Note 1091 Can't DROP INDEX `fk`; check that it exists
+Note 1091 Can't DROP COLUMN `c`; check that it exists
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
# End of 10.0 tests
#
#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 54fa4ad8c7e..aa9faf710f5 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -1804,6 +1804,37 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-15308
+--echo # Assertion `ha_alter_info->alter_info->drop_list.elements > 0' failed
+--echo # in ha_innodb::prepare_inplace_alter_table
+--echo #
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN b;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN b;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT, c INT, KEY(c)) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN c;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT, c INT, KEY c1(c)) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP INDEX c1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN IF EXISTS c;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.0 tests
--echo #
diff --git a/mysql-test/main/grant2.result b/mysql-test/main/grant2.result
index 2ccc01d225a..d7e42f9b7aa 100644
--- a/mysql-test/main/grant2.result
+++ b/mysql-test/main/grant2.result
@@ -809,10 +809,9 @@ LOAD INDEX INTO CACHE t3;
Table Op Msg_type Msg_text
mysqltest_db1.t3 preload_keys status OK
#
-# RENAME (doesn't work for temporary tables, thus should fail).
+# RENAME should work for temporary tables
#
RENAME TABLE t3 TO t3_1;
-ERROR 42000: INSERT, CREATE command denied to user 'mysqltest_u1'@'localhost' for table 't3_1'
#
# HANDLER OPEN/READ/CLOSE.
#
diff --git a/mysql-test/main/grant2.test b/mysql-test/main/grant2.test
index 5e8a130feea..cee5df089df 100644
--- a/mysql-test/main/grant2.test
+++ b/mysql-test/main/grant2.test
@@ -873,9 +873,8 @@ CACHE INDEX t3 IN keycache1;
LOAD INDEX INTO CACHE t3;
--echo #
---echo # RENAME (doesn't work for temporary tables, thus should fail).
+--echo # RENAME should work for temporary tables
--echo #
---error ER_TABLEACCESS_DENIED_ERROR
RENAME TABLE t3 TO t3_1;
--echo #
diff --git a/mysql-test/main/rename.result b/mysql-test/main/rename.result
index ff8566abe02..3ee9dd593d4 100644
--- a/mysql-test/main/rename.result
+++ b/mysql-test/main/rename.result
@@ -78,3 +78,69 @@ ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
drop view v1;
drop table t1;
End of 5.0 tests
+CREATE OR REPLACE TABLE t1 (a INT);
+CREATE OR REPLACE TABLE t2 (a INT);
+CREATE OR REPLACE TEMPORARY TABLE t1_tmp (b INT);
+CREATE OR REPLACE TEMPORARY TABLE t2_tmp (b INT);
+rename table t1 to t2;
+ERROR 42S01: Table 't2' already exists
+rename table t1 to tmp, tmp to t2;
+ERROR 42S01: Table 't2' already exists
+rename table t1_tmp to t2_tmp;
+ERROR 42S01: Table 't2_tmp' already exists
+rename table t1_tmp to tmp, tmp to t2_tmp;
+ERROR 42S01: Table 't2_tmp' already exists
+show create table t1_tmp;
+Table Create Table
+t1_tmp CREATE TEMPORARY TABLE `t1_tmp` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table t2_tmp;
+Table Create Table
+t2_tmp CREATE TEMPORARY TABLE `t2_tmp` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+rename table t1 to t1_tmp;
+rename table t2_tmp to t2;
+rename table t2 to tmp, tmp to t2;
+rename table t1_tmp to tmp, tmp to t1_tmp;
+show tables;
+Tables_in_test
+t1_tmp
+t2
+SHOW CREATE TABLE t1_tmp;
+Table Create Table
+t1_tmp CREATE TEMPORARY TABLE `t1_tmp` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1_tmp;
+SHOW CREATE TABLE t1_tmp;
+Table Create Table
+t1_tmp CREATE TABLE `t1_tmp` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1_tmp;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t2;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t2;
+CREATE TABLE t1 (a INT);
+insert into t1 values (1);
+CREATE TEMPORARY TABLE t1 (b INT);
+insert into t1 values (2);
+RENAME TABLE t1 TO tmp, t1 TO t2;
+select * from tmp;
+b
+2
+select * from t2;
+a
+1
+drop table tmp,t2;
diff --git a/mysql-test/main/rename.test b/mysql-test/main/rename.test
index a55bc845acc..67732d5b5b9 100644
--- a/mysql-test/main/rename.test
+++ b/mysql-test/main/rename.test
@@ -95,3 +95,49 @@ drop table t1;
--source include/wait_until_count_sessions.inc
+#
+# Test of rename with temporary tables
+#
+
+CREATE OR REPLACE TABLE t1 (a INT);
+CREATE OR REPLACE TABLE t2 (a INT);
+CREATE OR REPLACE TEMPORARY TABLE t1_tmp (b INT);
+CREATE OR REPLACE TEMPORARY TABLE t2_tmp (b INT);
+
+# Can't rename table over another one
+--error ER_TABLE_EXISTS_ERROR
+rename table t1 to t2;
+--error ER_TABLE_EXISTS_ERROR
+rename table t1 to tmp, tmp to t2;
+--error ER_TABLE_EXISTS_ERROR
+rename table t1_tmp to t2_tmp;
+--error ER_TABLE_EXISTS_ERROR
+rename table t1_tmp to tmp, tmp to t2_tmp;
+
+show create table t1_tmp;
+show create table t2_tmp;
+
+# The following should work
+rename table t1 to t1_tmp;
+rename table t2_tmp to t2;
+rename table t2 to tmp, tmp to t2;
+rename table t1_tmp to tmp, tmp to t1_tmp;
+show tables;
+SHOW CREATE TABLE t1_tmp;
+drop table t1_tmp;
+SHOW CREATE TABLE t1_tmp;
+drop table t1_tmp;
+SHOW CREATE TABLE t2;
+drop table t2;
+SHOW CREATE TABLE t2;
+drop table t2;
+
+CREATE TABLE t1 (a INT);
+insert into t1 values (1);
+CREATE TEMPORARY TABLE t1 (b INT);
+insert into t1 values (2);
+RENAME TABLE t1 TO tmp, t1 TO t2;
+select * from tmp;
+select * from t2;
+drop table tmp,t2;
+
diff --git a/mysql-test/main/statistics_close.result b/mysql-test/main/statistics_close.result
new file mode 100644
index 00000000000..d7f76e304e4
--- /dev/null
+++ b/mysql-test/main/statistics_close.result
@@ -0,0 +1,11 @@
+CREATE TABLE t1 (i int);
+connect con1,localhost,root,,test;
+RENAME TABLE t1 TO t2;
+connection default;
+FLUSH TABLES;
+connection con1;
+disconnect con1;
+connection default;
+DROP TABLE IF EXISTS t1, t2;
+Warnings:
+Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/main/statistics_close.test b/mysql-test/main/statistics_close.test
new file mode 100644
index 00000000000..de22a5a44fe
--- /dev/null
+++ b/mysql-test/main/statistics_close.test
@@ -0,0 +1,18 @@
+#
+# MDEV-16123 ASAN heap-use-after-free handler::ha_index_or_rnd_end
+# MDEV-13828 Segmentation fault on RENAME TABLE
+#
+
+CREATE TABLE t1 (i int);
+--connect (con1,localhost,root,,test)
+--send
+RENAME TABLE t1 TO t2;
+--connection default
+FLUSH TABLES;
+--connection con1
+--reap
+
+# Cleanup
+--disconnect con1
+--connection default
+DROP TABLE IF EXISTS t1, t2;
diff --git a/mysql-test/main/trigger.result b/mysql-test/main/trigger.result
index 8473b3bb90d..537f86e9f40 100644
--- a/mysql-test/main/trigger.result
+++ b/mysql-test/main/trigger.result
@@ -2345,7 +2345,18 @@ CREATE TABLE t1 (i INT);
insert into t2 value (2);
DROP VIEW v1;
DROP TABLE t1,t2,t3;
-End of 10.1 tests.
+#
+# MDEV-16093
+# Assertion `global_status_var.global_memory_used == 0' failed or
+# bytes lost after inserting into table with non-null blob and trigger
+#
+CREATE TABLE t1 (b BLOB NOT NULL);
+CREATE TRIGGER tr BEFORE UPDATE ON t1 FOR EACH ROW BEGIN END;
+INSERT INTO t1 VALUES ('foo');
+DROP TABLE t1;
+#
+# End of 10.1 tests.
+#
create table t1 (i int);
create trigger tr1 after insert on t1 for each row set @a=@a+1;
create trigger tr2 after insert on t1 for each row set @a=@a+1;
diff --git a/mysql-test/main/trigger.test b/mysql-test/main/trigger.test
index 1557ef200e5..020117e046f 100644
--- a/mysql-test/main/trigger.test
+++ b/mysql-test/main/trigger.test
@@ -2665,8 +2665,20 @@ insert into t2 value (2);
DROP VIEW v1;
DROP TABLE t1,t2,t3;
+--echo #
+--echo # MDEV-16093
+--echo # Assertion `global_status_var.global_memory_used == 0' failed or
+--echo # bytes lost after inserting into table with non-null blob and trigger
+--echo #
+
+CREATE TABLE t1 (b BLOB NOT NULL);
+CREATE TRIGGER tr BEFORE UPDATE ON t1 FOR EACH ROW BEGIN END;
+INSERT INTO t1 VALUES ('foo');
+DROP TABLE t1;
---echo End of 10.1 tests.
+--echo #
+--echo # End of 10.1 tests.
+--echo #
#
# MDEV-10915 Count number of executed triggers
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master.test b/mysql-test/suite/binlog_encryption/encrypted_master.test
index 503a40443d2..f67e93ce815 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master.test
+++ b/mysql-test/suite/binlog_encryption/encrypted_master.test
@@ -18,6 +18,7 @@
# - with annotated events, default checksums and minimal binlog row image
#
+--source include/have_partition.inc
--source encryption_algorithms.inc
--source include/have_innodb.inc
--enable_connect_log
diff --git a/mysql-test/suite/binlog_encryption/encrypted_slave.test b/mysql-test/suite/binlog_encryption/encrypted_slave.test
index f5697d91779..94777957b92 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_slave.test
+++ b/mysql-test/suite/binlog_encryption/encrypted_slave.test
@@ -9,6 +9,7 @@
# relay logs and binary logs are encrypted on slave.
#
+--source include/have_partition.inc
--source encryption_algorithms.inc
--source include/have_innodb.inc
diff --git a/mysql-test/suite/binlog_encryption/testdata.opt b/mysql-test/suite/binlog_encryption/testdata.opt
deleted file mode 100644
index b0c5b9c8188..00000000000
--- a/mysql-test/suite/binlog_encryption/testdata.opt
+++ /dev/null
@@ -1 +0,0 @@
---partition
diff --git a/mysql-test/suite/galera/r/galera_encrypt_tmp_files.result b/mysql-test/suite/galera/r/galera_encrypt_tmp_files.result
new file mode 100644
index 00000000000..38480d186ba
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_encrypt_tmp_files.result
@@ -0,0 +1,37 @@
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+connection node_2;
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE = 'Synced'
+1
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 2
+1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+connection node_1;
+CREATE TABLE `t1` (
+`col1` int(11) NOT NULL,
+`col2` varchar(64) NOT NULL DEFAULT '',
+`col3` varchar(32) NOT NULL DEFAULT '0',
+`col4` varchar(64) NOT NULL DEFAULT '',
+`col5` tinyint(4) NOT NULL DEFAULT '0',
+`col6` int(11) NOT NULL DEFAULT '0',
+`col7` varchar(64) NOT NULL DEFAULT '',
+`col8` tinyint(4) NOT NULL DEFAULT '0',
+`col9` tinyint(4) NOT NULL DEFAULT '0',
+`col10` text NOT NULL,
+`col11` varchar(255) NOT NULL DEFAULT '',
+`col12` tinyint(4) NOT NULL DEFAULT '1'
+) ;
+create table t2 (test int);
+insert into t2 values (1);
+drop table t1,t2;
diff --git a/mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf b/mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf
new file mode 100644
index 00000000000..0f7f80b7d0b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf
@@ -0,0 +1,8 @@
+!include ../galera_2nodes.cnf
+[mysqld]
+
+encrypt-tmp-files = 1
+plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
+file-key-management
+loose-file-key-management-filename= @ENV.MYSQL_TEST_DIR/std_data/keys.txt
+log-bin
diff --git a/mysql-test/suite/galera/t/galera_encrypt_tmp_files.test b/mysql-test/suite/galera/t/galera_encrypt_tmp_files.test
new file mode 100644
index 00000000000..c42c3dbd98a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_encrypt_tmp_files.test
@@ -0,0 +1,57 @@
+# This file tests that mariadb cluster should not crash when encrypt_tmp_file
+# is enabled
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+--connection node_1
+
+CREATE TABLE `t1` (
+ `col1` int(11) NOT NULL,
+ `col2` varchar(64) NOT NULL DEFAULT '',
+ `col3` varchar(32) NOT NULL DEFAULT '0',
+ `col4` varchar(64) NOT NULL DEFAULT '',
+ `col5` tinyint(4) NOT NULL DEFAULT '0',
+ `col6` int(11) NOT NULL DEFAULT '0',
+ `col7` varchar(64) NOT NULL DEFAULT '',
+ `col8` tinyint(4) NOT NULL DEFAULT '0',
+ `col9` tinyint(4) NOT NULL DEFAULT '0',
+ `col10` text NOT NULL,
+ `col11` varchar(255) NOT NULL DEFAULT '',
+ `col12` tinyint(4) NOT NULL DEFAULT '1'
+) ;
+
+#Although we just need $counter >= 907 for IO_CACHE to use
+#encrypted temp file. Just on safe side I am using $counter
+# = 1100
+--disable_query_log
+--let $counter=1100
+--let $query= (1,'test','test','test',0,0,'-1',0,0,'','',-1)
+while($counter)
+{
+ --let $query= $query ,(1,'test','test','test',0,0,'-1',0,0,'','',-1)
+ --dec $counter
+}
+--let $query= INSERT INTO t1 values $query ;
+--eval $query
+--enable_query_log
+#INSERT INTO `t1` VALUE
+
+create table t2 (test int);
+insert into t2 values (1);
+
+drop table t1,t2;
diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
index 138b7c1c703..3e2108868af 100644
--- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test
+++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
@@ -4,6 +4,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+--source include/have_perfschema.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
diff --git a/mysql-test/suite/maria/lock.result b/mysql-test/suite/maria/lock.result
index 99f76e6115c..660f64070ca 100644
--- a/mysql-test/suite/maria/lock.result
+++ b/mysql-test/suite/maria/lock.result
@@ -100,6 +100,17 @@ f2
unlock tables;
DROP TABLE t1,t2,tmp;
#
+# MDEV-10378 Assertion `trn' failed in virtual int ha_maria::start_stmt
+#
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT, pk INT, PRIMARY KEY (pk)) ENGINE=Aria;
+INSERT INTO t1 VALUES ('foo',10,1), ('foo',1,2);
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD UNIQUE KEY (f1);
+ERROR 23000: Duplicate entry 'foo' for key 'f1'
+ALTER TABLE t1 ADD KEY (f2);
+DROP TABLE t1;
+# End of 10.2 tests
+#
# MDEV-14669 Assertion `file->trn == trn' failed in ha_maria::start_stmt
#
CREATE TABLE t1 (i INT) ENGINE=Aria;
diff --git a/mysql-test/suite/maria/lock.test b/mysql-test/suite/maria/lock.test
index be9ec7f6bf6..37356a359d8 100644
--- a/mysql-test/suite/maria/lock.test
+++ b/mysql-test/suite/maria/lock.test
@@ -107,6 +107,20 @@ unlock tables;
DROP TABLE t1,t2,tmp;
--echo #
+--echo # MDEV-10378 Assertion `trn' failed in virtual int ha_maria::start_stmt
+--echo #
+
+CREATE TABLE t1 (f1 VARCHAR(3), f2 INT, pk INT, PRIMARY KEY (pk)) ENGINE=Aria;
+INSERT INTO t1 VALUES ('foo',10,1), ('foo',1,2);
+LOCK TABLE t1 WRITE;
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD UNIQUE KEY (f1);
+ALTER TABLE t1 ADD KEY (f2);
+DROP TABLE t1;
+
+--echo # End of 10.2 tests
+
+--echo #
--echo # MDEV-14669 Assertion `file->trn == trn' failed in ha_maria::start_stmt
--echo #
diff --git a/mysql-test/suite/mariabackup/lock_ddl_per_table.opt b/mysql-test/suite/mariabackup/lock_ddl_per_table.opt
new file mode 100644
index 00000000000..bbb6d7f9ff4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/lock_ddl_per_table.opt
@@ -0,0 +1 @@
+--loose-partition
diff --git a/mysql-test/suite/mariabackup/lock_ddl_per_table.test b/mysql-test/suite/mariabackup/lock_ddl_per_table.test
index 04edb9e05e9..2689508e554 100644
--- a/mysql-test/suite/mariabackup/lock_ddl_per_table.test
+++ b/mysql-test/suite/mariabackup/lock_ddl_per_table.test
@@ -1,4 +1,5 @@
--source include/have_debug.inc
+--source include/have_partition.inc
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
diff --git a/mysql-test/suite/mariabackup/partition_datadir.opt b/mysql-test/suite/mariabackup/partition_datadir.opt
deleted file mode 100644
index 8a3240370eb..00000000000
--- a/mysql-test/suite/mariabackup/partition_datadir.opt
+++ /dev/null
@@ -1 +0,0 @@
---partition \ No newline at end of file
diff --git a/mysql-test/suite/mariabackup/partition_datadir.test b/mysql-test/suite/mariabackup/partition_datadir.test
index 882b0111267..c525d34a02c 100644
--- a/mysql-test/suite/mariabackup/partition_datadir.test
+++ b/mysql-test/suite/mariabackup/partition_datadir.test
@@ -1,3 +1,4 @@
+--source include/have_partition.inc
let $targetdir=$MYSQLTEST_VARDIR/backup;
mkdir $targetdir;
mkdir $MYSQLTEST_VARDIR/partitdata;
diff --git a/mysql-test/suite/mariabackup/suite.opt b/mysql-test/suite/mariabackup/suite.opt
index 752a2e41983..3b5cc4f4c45 100644
--- a/mysql-test/suite/mariabackup/suite.opt
+++ b/mysql-test/suite/mariabackup/suite.opt
@@ -1 +1 @@
---innodb --loose-changed_page_bitmaps --innodb-sys-tables --partition
+--innodb --loose-changed_page_bitmaps --innodb-sys-tables
diff --git a/mysql-test/suite/perfschema/r/partition.result b/mysql-test/suite/perfschema/r/partition.result
new file mode 100644
index 00000000000..9bc624268bb
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/partition.result
@@ -0,0 +1,10 @@
+#
+# MDEV-10679
+# Server crashes in in mysql_create_frm_image upon query from
+# performance schema in ps-protocol mode
+#
+CREATE TABLE t1 (i INT);
+ALTER TABLE t1 ADD PARTITION (PARTITION p VALUES LESS THAN (1));
+ERROR HY000: Partition management on a not partitioned table is not possible
+SELECT * FROM performance_schema.events_stages_summary_by_user_by_event_name;
+DROP TABLE t1;
diff --git a/mysql-test/suite/perfschema/t/partition.test b/mysql-test/suite/perfschema/t/partition.test
new file mode 100644
index 00000000000..0b3b204dee7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/partition.test
@@ -0,0 +1,16 @@
+--source include/have_perfschema.inc
+--source include/have_partition.inc
+
+--echo #
+--echo # MDEV-10679
+--echo # Server crashes in in mysql_create_frm_image upon query from
+--echo # performance schema in ps-protocol mode
+--echo #
+
+CREATE TABLE t1 (i INT);
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED
+ALTER TABLE t1 ADD PARTITION (PARTITION p VALUES LESS THAN (1));
+--disable_result_log
+SELECT * FROM performance_schema.events_stages_summary_by_user_by_event_name;
+--enable_result_log
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rename.result b/mysql-test/suite/rpl/r/rename.result
new file mode 100644
index 00000000000..8220ae1f3b1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rename.result
@@ -0,0 +1,36 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-16229 Replication aborts with ER_VIEW_SELECT_TMPTABLE after
+# half-failed RENAME
+#
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t1 (b INT);
+RENAME TABLE t1 TO tmp, tmp TO t1;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE VIEW v AS SELECT * FROM t1;
+ERROR HY000: View's SELECT refers to a temporary table 't1'
+RENAME TABLE t1 TO tmp, t1 TO t2;
+SHOW CREATE TABLE tmp;
+Table Create Table
+tmp CREATE TEMPORARY TABLE `tmp` (
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE VIEW v AS SELECT * FROM tmp;
+ERROR HY000: View's SELECT refers to a temporary table 'tmp'
+CREATE VIEW v AS SELECT * FROM t2;
+connection slave;
+connection master;
+DROP VIEW v;
+DROP TABLE tmp;
+DROP TABLE t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rename.test b/mysql-test/suite/rpl/t/rename.test
new file mode 100644
index 00000000000..ac499157918
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rename.test
@@ -0,0 +1,33 @@
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-16229 Replication aborts with ER_VIEW_SELECT_TMPTABLE after
+--echo # half-failed RENAME
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE TEMPORARY TABLE t1 (b INT);
+RENAME TABLE t1 TO tmp, tmp TO t1;
+SHOW CREATE TABLE t1;
+--error ER_VIEW_SELECT_TMPTABLE
+CREATE VIEW v AS SELECT * FROM t1;
+
+RENAME TABLE t1 TO tmp, t1 TO t2;
+SHOW CREATE TABLE tmp;
+SHOW CREATE TABLE t2;
+--error ER_VIEW_SELECT_TMPTABLE
+CREATE VIEW v AS SELECT * FROM tmp;
+CREATE VIEW v AS SELECT * FROM t2;
+
+--sync_slave_with_master
+
+# Cleanup
+
+--connection master
+
+DROP VIEW v;
+DROP TABLE tmp;
+DROP TABLE t2;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/vcol/r/binlog.result b/mysql-test/suite/vcol/r/binlog.result
new file mode 100644
index 00000000000..35bfb50ba2f
--- /dev/null
+++ b/mysql-test/suite/vcol/r/binlog.result
@@ -0,0 +1,70 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (
+pk SERIAL,
+vcol_date DATE AS (col_date) PERSISTENT,
+vcol_int INT AS (col_int) VIRTUAL,
+vcol_year YEAR AS (col_year) PERSISTENT,
+vcol_blob BLOB AS (col_blob) VIRTUAL,
+col_date DATE,
+col_int INT NULL,
+col_blob BLOB NULL,
+col_year YEAR,
+PRIMARY KEY(pk)
+) ENGINE=InnoDB;
+INSERT INTO t1 (col_date,col_int,col_blob,col_year) VALUES ('2010-04-24',5,'foo',1981);
+SET SQL_MODE='';
+set binlog_row_image="FULL";
+CREATE VIEW v1 AS SELECT * FROM t1;
+REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1982 FROM t1;
+Warnings:
+Warning 1906 The value specified for generated column 'vcol_date' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_int' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_year' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_blob' in table 't1' ignored
+select col_date,col_int,col_blob,col_year from v1;
+col_date col_int col_blob col_year
+2010-04-24 5 foo 1982
+connection slave;
+select col_date,col_int,col_blob,col_year from v1;
+col_date col_int col_blob col_year
+2010-04-24 5 foo 1982
+connection master;
+DROP VIEW v1;
+set binlog_row_image="MINIMAL";
+CREATE VIEW v1 AS SELECT * FROM t1;
+REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1983 FROM t1;
+Warnings:
+Warning 1906 The value specified for generated column 'vcol_date' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_int' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_year' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_blob' in table 't1' ignored
+select col_date,col_int,col_blob,col_year from v1;
+col_date col_int col_blob col_year
+2010-04-24 5 foo 1983
+connection slave;
+select col_date,col_int,col_blob,col_year from v1;
+col_date col_int col_blob col_year
+2010-04-24 5 foo 1983
+connection master;
+DROP VIEW v1;
+set @@binlog_row_image="NOBLOB";
+CREATE VIEW v1 AS SELECT * FROM t1;
+REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1984 FROM t1;
+Warnings:
+Warning 1906 The value specified for generated column 'vcol_date' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_int' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_year' in table 't1' ignored
+Warning 1906 The value specified for generated column 'vcol_blob' in table 't1' ignored
+select col_date,col_int,col_blob,col_year from v1;
+col_date col_int col_blob col_year
+2010-04-24 5 foo 1984
+connection slave;
+select col_date,col_int,col_blob,col_year from v1;
+col_date col_int col_blob col_year
+2010-04-24 5 foo 1984
+connection master;
+DROP VIEW v1;
+set @@binlog_row_image=default;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/vcol/r/update_binlog.result b/mysql-test/suite/vcol/r/update_binlog.result
new file mode 100644
index 00000000000..d4102fc460a
--- /dev/null
+++ b/mysql-test/suite/vcol/r/update_binlog.result
@@ -0,0 +1,361 @@
+set binlog_row_image="FULL";
+set @@default_storage_engine="myisam";
+create table t1 (a int, b int as (a+1), c int as (b+1) stored);
+insert t1 set a=1;
+select * from t1;
+a b c
+1 2 3
+update t1 set a=2;
+select * from t1;
+a b c
+2 3 4
+drop table t1;
+create table t1 (a int, c int as(a), p varchar(20) as(y), y char(20), index (p,c));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `c` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL,
+ `p` varchar(20) GENERATED ALWAYS AS (`y`) VIRTUAL,
+ `y` char(20) DEFAULT NULL,
+ KEY `p` (`p`,`c`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 (a,y) values(1, "yyy");
+update t1 set a = 100 where a = 1;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create table t1 (
+a varchar(10000),
+b varchar(3000),
+c varchar(14000) generated always as (concat(a,b)) virtual,
+d varchar(5000) generated always as (b) virtual,
+e int(11) generated always as (10) virtual,
+h int(11) not null primary key,
+index(c(100), d(20)));
+insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1);
+update t1 set a = repeat(cast(1 as char), 2000);
+drop table t1;
+create table t1 (
+a varchar(10000),
+b varchar(3000),
+c varchar(14000) generated always as (concat(a,b)) virtual,
+i varchar(5000) generated always as (b) virtual,
+d varchar(5000) generated always as (i) virtual,
+e int(11) generated always as (10) virtual,
+h int(11) not null primary key,
+index(c(100), d(20)));
+insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1);
+update t1 set a = repeat(cast(1 as char), 2000);
+drop table t1;
+create table t1(a blob not null, b int, c varbinary (10) generated always as (a) virtual, unique (c(9)));
+insert t1 (a,b) values ('a', 1);
+replace t1 set a = 'a',b =1;
+insert t1 (a,b) values ('a', 1) on duplicate key update a='b', b=2;
+select * from t1;
+a b c
+b 2 b
+drop table t1;
+create table t (a int primary key, b int, c int as (b), index (c));
+insert t (a,b) values (9,0);
+create table t2 select * from t;
+update t, t2 set t.b=10 where t.a=t2.a;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c
+9 10 10
+drop table t, t2;
+create table t1 (a int, b int, c int, d int, e int);
+insert t1 values (1,2,3,4,5), (1,2,3,4,5);
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
+create table t (a int primary key,
+b int, c blob as (b), index (c(57)),
+d blob, e blob as (d), index (e(57)))
+replace select * from t1;
+Warnings:
+Warning 1906 The value specified for generated column 'c' in table 't' ignored
+Warning 1906 The value specified for generated column 'e' in table 't' ignored
+Warning 1906 The value specified for generated column 'c' in table 't' ignored
+Warning 1906 The value specified for generated column 'e' in table 't' ignored
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+1 2 2 4 4
+update t set a=10, b=1, d=1;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 1 1 1 1
+replace t (a,b,d) values (10,2,2);
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 2 2 2 2
+insert t(a,b,d) values (10) on duplicate key update b=3;
+ERROR 21S01: Column count doesn't match value count at row 1
+insert t(a,b,d) values (10,2,2) on duplicate key update b=3, d=3;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 3 3 3 3
+replace t (a,b,d) select 10,4,4;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 4 4 4 4
+insert t(a,b,d) select 10,4,4 on duplicate key update b=5, d=5;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 5 5 5 5
+replace delayed t (a,b,d) values (10,6,6);
+flush tables;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 6 6 6 6
+insert delayed t(a,b,d) values (10,6,6) on duplicate key update b=7, d=7;
+flush tables;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 7 7 7 7
+load data infile 'MYSQLTEST_VARDIR/tmp/vblobs.txt' replace into table t;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 8 8 8 8
+update t set a=11, b=9, d=9 where a>5;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+11 9 9 9 9
+create table t2 select * from t;
+update t, t2 set t.b=10, t.d=10 where t.a=t2.a;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+11 10 10 10 10
+update t, t tt set t.b=11, tt.d=11 where t.a=tt.a;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+11 11 11 11 11
+drop table t, t1, t2;
+create table t (f1 int, f2 int, f3 int as (f1*2) virtual, key(f3,f2));
+insert into t (f1,f2) values (1,1),(2,2);
+create view v as
+select a2.f1, a2.f2, a1.f3
+from t a1, t a2
+where a2.f3 <> 0
+with local check option;
+update v set f3 = 52;
+drop view v;
+drop table t;
+set binlog_row_image="MINIMAL";
+create table t1 (a int, b int as (a+1), c int as (b+1) stored);
+insert t1 set a=1;
+select * from t1;
+a b c
+1 2 3
+update t1 set a=2;
+select * from t1;
+a b c
+2 3 4
+drop table t1;
+create table t1 (a int, c int as(a), p varchar(20) as(y), y char(20), index (p,c));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `c` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL,
+ `p` varchar(20) GENERATED ALWAYS AS (`y`) VIRTUAL,
+ `y` char(20) DEFAULT NULL,
+ KEY `p` (`p`,`c`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 (a,y) values(1, "yyy");
+update t1 set a = 100 where a = 1;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create table t1 (
+a varchar(10000),
+b varchar(3000),
+c varchar(14000) generated always as (concat(a,b)) virtual,
+d varchar(5000) generated always as (b) virtual,
+e int(11) generated always as (10) virtual,
+h int(11) not null primary key,
+index(c(100), d(20)));
+insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1);
+update t1 set a = repeat(cast(1 as char), 2000);
+drop table t1;
+create table t1 (
+a varchar(10000),
+b varchar(3000),
+c varchar(14000) generated always as (concat(a,b)) virtual,
+i varchar(5000) generated always as (b) virtual,
+d varchar(5000) generated always as (i) virtual,
+e int(11) generated always as (10) virtual,
+h int(11) not null primary key,
+index(c(100), d(20)));
+insert t1 (a,b,h) values (repeat('g', 10000), repeat('x', 2800), 1);
+update t1 set a = repeat(cast(1 as char), 2000);
+drop table t1;
+create table t1(a blob not null, b int, c varbinary (10) generated always as (a) virtual, unique (c(9)));
+insert t1 (a,b) values ('a', 1);
+replace t1 set a = 'a',b =1;
+insert t1 (a,b) values ('a', 1) on duplicate key update a='b', b=2;
+select * from t1;
+a b c
+b 2 b
+drop table t1;
+create table t (a int primary key, b int, c int as (b), index (c));
+insert t (a,b) values (9,0);
+create table t2 select * from t;
+update t, t2 set t.b=10 where t.a=t2.a;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c
+9 10 10
+drop table t, t2;
+create table t1 (a int, b int, c int, d int, e int);
+insert t1 values (1,2,3,4,5), (1,2,3,4,5);
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
+create table t (a int primary key,
+b int, c blob as (b), index (c(57)),
+d blob, e blob as (d), index (e(57)))
+replace select * from t1;
+Warnings:
+Warning 1906 The value specified for generated column 'c' in table 't' ignored
+Warning 1906 The value specified for generated column 'e' in table 't' ignored
+Warning 1906 The value specified for generated column 'c' in table 't' ignored
+Warning 1906 The value specified for generated column 'e' in table 't' ignored
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+1 2 2 4 4
+update t set a=10, b=1, d=1;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 1 1 1 1
+replace t (a,b,d) values (10,2,2);
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 2 2 2 2
+insert t(a,b,d) values (10) on duplicate key update b=3;
+ERROR 21S01: Column count doesn't match value count at row 1
+insert t(a,b,d) values (10,2,2) on duplicate key update b=3, d=3;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 3 3 3 3
+replace t (a,b,d) select 10,4,4;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 4 4 4 4
+insert t(a,b,d) select 10,4,4 on duplicate key update b=5, d=5;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 5 5 5 5
+replace delayed t (a,b,d) values (10,6,6);
+flush tables;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 6 6 6 6
+insert delayed t(a,b,d) values (10,6,6) on duplicate key update b=7, d=7;
+flush tables;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 7 7 7 7
+load data infile 'MYSQLTEST_VARDIR/tmp/vblobs.txt' replace into table t;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+10 8 8 8 8
+update t set a=11, b=9, d=9 where a>5;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+11 9 9 9 9
+create table t2 select * from t;
+update t, t2 set t.b=10, t.d=10 where t.a=t2.a;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+11 10 10 10 10
+update t, t tt set t.b=11, tt.d=11 where t.a=tt.a;
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a b c d e
+11 11 11 11 11
+drop table t, t1, t2;
+create table t (f1 int, f2 int, f3 int as (f1*2) virtual, key(f3,f2));
+insert into t (f1,f2) values (1,1),(2,2);
+create view v as
+select a2.f1, a2.f2, a1.f3
+from t a1, t a2
+where a2.f3 <> 0
+with local check option;
+update v set f3 = 52;
+drop view v;
+drop table t;
diff --git a/mysql-test/suite/vcol/t/binlog.test b/mysql-test/suite/vcol/t/binlog.test
new file mode 100644
index 00000000000..95bb4df4cc5
--- /dev/null
+++ b/mysql-test/suite/vcol/t/binlog.test
@@ -0,0 +1,55 @@
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+#
+# MDEV-15243
+# Server crashes in in Field_blob::pack upon REPLACE into view with virtual
+# columns with binlog enabled
+#
+
+CREATE TABLE t1 (
+ pk SERIAL,
+ vcol_date DATE AS (col_date) PERSISTENT,
+ vcol_int INT AS (col_int) VIRTUAL,
+ vcol_year YEAR AS (col_year) PERSISTENT,
+ vcol_blob BLOB AS (col_blob) VIRTUAL,
+ col_date DATE,
+ col_int INT NULL,
+ col_blob BLOB NULL,
+ col_year YEAR,
+ PRIMARY KEY(pk)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (col_date,col_int,col_blob,col_year) VALUES ('2010-04-24',5,'foo',1981);
+SET SQL_MODE='';
+
+set binlog_row_image="FULL";
+CREATE VIEW v1 AS SELECT * FROM t1;
+REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1982 FROM t1;
+select col_date,col_int,col_blob,col_year from v1;
+sync_slave_with_master;
+select col_date,col_int,col_blob,col_year from v1;
+connection master;
+DROP VIEW v1;
+set binlog_row_image="MINIMAL";
+CREATE VIEW v1 AS SELECT * FROM t1;
+REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1983 FROM t1;
+select col_date,col_int,col_blob,col_year from v1;
+sync_slave_with_master;
+select col_date,col_int,col_blob,col_year from v1;
+connection master;
+DROP VIEW v1;
+set @@binlog_row_image="NOBLOB";
+CREATE VIEW v1 AS SELECT * FROM t1;
+REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1984 FROM t1;
+select col_date,col_int,col_blob,col_year from v1;
+sync_slave_with_master;
+select col_date,col_int,col_blob,col_year from v1;
+connection master;
+DROP VIEW v1;
+set @@binlog_row_image=default;
+
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/vcol/t/update_binlog.test b/mysql-test/suite/vcol/t/update_binlog.test
new file mode 100644
index 00000000000..458aac480c7
--- /dev/null
+++ b/mysql-test/suite/vcol/t/update_binlog.test
@@ -0,0 +1,14 @@
+#
+# Check that vcol update works with binlog enabled
+#
+
+--source include/have_binlog_format_row.inc
+
+set binlog_row_image="FULL";
+set @@default_storage_engine="myisam";
+
+--source update.test
+
+set binlog_row_image="MINIMAL";
+
+--source update.test