summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-01-24 22:42:35 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-01-24 22:42:35 +0200
commit78829a5780d3e48da376c1ca4e62731da450c551 (patch)
tree6561f2b6f09662220b9965bb14d745f69a4ecd34
parentd6ba8496175a2dd85d772f8486eb032c31969f59 (diff)
parent947b6b849d907dc0793f076aec7e553869db744f (diff)
downloadmariadb-git-78829a5780d3e48da376c1ca4e62731da450c551.tar.gz
Merge 10.3 into 10.4
-rw-r--r--client/CMakeLists.txt2
-rw-r--r--debian/mariadb-server-10.4.install3
-rw-r--r--extra/mariabackup/fil_cur.cc2
-rw-r--r--extra/mariabackup/xtrabackup.cc12
-rw-r--r--extra/mariabackup/xtrabackup.h2
-rw-r--r--libmysqld/examples/CMakeLists.txt2
-rw-r--r--man/CMakeLists.txt1
-rw-r--r--man/wsrep_sst_xtrabackup-v2.118
-rw-r--r--man/wsrep_sst_xtrabackup.118
-rw-r--r--mysql-test/main/connect.result8
-rw-r--r--mysql-test/main/connect.test4
-rw-r--r--mysql-test/main/huge_frm-6224.result5
-rw-r--r--mysql-test/main/huge_frm-6224.test11
-rw-r--r--mysql-test/main/mysqlbinlog_row_compressed.result16
-rw-r--r--mysql-test/main/mysqlbinlog_row_minimal.result16
-rw-r--r--mysql-test/main/range_innodb.result24
-rw-r--r--mysql-test/main/range_innodb.test25
-rwxr-xr-xmysql-test/mysql-test-run.pl1
-rw-r--r--mysql-test/suite/galera/disabled.def2
-rw-r--r--mysql-test/suite/galera/r/galera_drop_database.result8
-rw-r--r--mysql-test/suite/galera/t/galera_drop_database.test26
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def2
-rw-r--r--mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf12
-rw-r--r--mysql-test/suite/galera_3nodes/galera_3nodes.cnf6
-rw-r--r--mysql-test/suite/galera_3nodes/include/have_mariabackup.inc4
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup.result22
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result13
-rw-r--r--mysql-test/suite/galera_3nodes/suite.pm44
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf4
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf29
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt1
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test59
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf10
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt2
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test40
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf10
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt1
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result9
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_index.result20
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test9
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_index.test19
-rw-r--r--mysql-test/suite/innodb/r/alter_candidate_key.result114
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-table-online.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb_28867993.result9
-rw-r--r--mysql-test/suite/innodb/t/alter_candidate_key.test72
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_28867993.test12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff31
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_big_table_id.result46
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_big_table_id.test57
-rw-r--r--mysql-test/suite/wsrep/r/variables.result3
-rw-r--r--mysql-test/suite/wsrep/t/variables.test6
-rwxr-xr-xscripts/wsrep_sst_common.sh6
-rw-r--r--scripts/wsrep_sst_mariabackup.sh105
-rw-r--r--scripts/wsrep_sst_rsync.sh17
-rw-r--r--sql/log_event.cc4
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/opt_range.cc1
-rw-r--r--sql/sql_table.cc16
-rw-r--r--sql/sys_vars.cc3
-rw-r--r--sql/table.cc6
-rw-r--r--sql/table.h4
-rw-r--r--sql/unireg.h2
-rw-r--r--sql/wsrep_mysqld.cc2
-rw-r--r--sql/wsrep_sst.cc7
-rw-r--r--sql/wsrep_utils.h3
-rw-r--r--storage/innobase/dict/dict0dict.cc38
-rw-r--r--storage/innobase/fil/fil0fil.cc16
-rw-r--r--storage/innobase/handler/ha_innodb.cc9
-rw-r--r--storage/innobase/include/dict0mem.h13
-rw-r--r--storage/innobase/include/row0upd.h8
-rw-r--r--storage/innobase/include/univ.i4
-rw-r--r--storage/innobase/os/os0file.cc10
-rw-r--r--storage/innobase/row/row0ins.cc16
-rw-r--r--storage/innobase/row/row0log.cc5
-rw-r--r--storage/innobase/row/row0upd.cc11
-rw-r--r--storage/innobase/srv/srv0srv.cc2
-rw-r--r--storage/innobase/srv/srv0start.cc4
-rw-r--r--support-files/policy/apparmor/usr.sbin.mysqld3
-rw-r--r--support-files/policy/selinux/mariadb-server.fc2
-rw-r--r--support-files/policy/selinux/mariadb-server.te4
83 files changed, 945 insertions, 270 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index e2329f505ab..ff6422d15da 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -46,7 +46,7 @@ ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
-TARGET_LINK_LIBRARIES(mysqltest ${CLIENT_LIB} pcre pcreposix)
+TARGET_LINK_LIBRARIES(mysqltest ${CLIENT_LIB} pcreposix pcre)
SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE)
diff --git a/debian/mariadb-server-10.4.install b/debian/mariadb-server-10.4.install
index e0f83fbe95b..292c2c2a521 100644
--- a/debian/mariadb-server-10.4.install
+++ b/debian/mariadb-server-10.4.install
@@ -90,8 +90,7 @@ usr/share/man/man1/resolveip.1
usr/share/man/man1/wsrep_sst_common.1
usr/share/man/man1/wsrep_sst_mysqldump.1
usr/share/man/man1/wsrep_sst_rsync.1
-usr/share/man/man1/wsrep_sst_xtrabackup-v2.1
-usr/share/man/man1/wsrep_sst_xtrabackup.1
+usr/share/man/man1/wsrep_sst_mariabackup.1
usr/share/mysql/errmsg-utf8.txt
usr/share/mysql/fill_help_tables.sql
usr/share/mysql/maria_add_gis_sp_bootstrap.sql
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index 9e9fdb2e1f4..f40304c07d7 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -321,7 +321,7 @@ static bool page_is_corrupted(const byte *page, ulint page_no,
page_no first. */
if (page_no
&& mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION)
- && (opt_backup_encrypted
+ && (opt_encrypted_backup
|| (space->crypt_data
&& space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED))) {
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index a094f1897e3..3ad3de2b6c8 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -201,7 +201,7 @@ static char* log_ignored_opt;
extern my_bool opt_use_ssl;
my_bool opt_ssl_verify_server_cert;
my_bool opt_extended_validation;
-my_bool opt_backup_encrypted;
+my_bool opt_encrypted_backup;
/* === metadata of backup === */
#define XTRABACKUP_METADATA_FILENAME "xtrabackup_checkpoints"
@@ -760,7 +760,7 @@ enum options_xtrabackup
OPT_XTRA_DATABASES_FILE,
OPT_XTRA_PARALLEL,
OPT_XTRA_EXTENDED_VALIDATION,
- OPT_XTRA_BACKUP_ENCRYPTED,
+ OPT_XTRA_ENCRYPTED_BACKUP,
OPT_XTRA_STREAM,
OPT_XTRA_COMPRESS,
OPT_XTRA_COMPRESS_THREADS,
@@ -1226,12 +1226,12 @@ struct my_option xb_server_options[] =
(G_PTR*)&opt_extended_validation,
0, GET_BOOL, NO_ARG, FALSE, 0, 0, 0, 0, 0},
- {"backup_encrypted", OPT_XTRA_BACKUP_ENCRYPTED,
+ {"encrypted_backup", OPT_XTRA_ENCRYPTED_BACKUP,
"In --backup, assume that nonzero key_version implies that the page"
- " is encrypted. Use --backup --skip-backup-encrypted to allow"
+ " is encrypted. Use --backup --skip-encrypted-backup to allow"
" copying unencrypted that were originally created before MySQL 5.1.48.",
- (G_PTR*)&opt_backup_encrypted,
- (G_PTR*)&opt_backup_encrypted,
+ (G_PTR*)&opt_encrypted_backup,
+ (G_PTR*)&opt_encrypted_backup,
0, GET_BOOL, NO_ARG, TRUE, 0, 0, 0, 0, 0},
{"log", OPT_LOG, "Ignored option for MySQL option compatibility",
diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h
index 8e0e09f6f07..90f5e28e2c7 100644
--- a/extra/mariabackup/xtrabackup.h
+++ b/extra/mariabackup/xtrabackup.h
@@ -108,7 +108,7 @@ extern my_bool opt_no_backup_locks;
extern my_bool opt_decompress;
extern my_bool opt_remove_original;
extern my_bool opt_extended_validation;
-extern my_bool opt_backup_encrypted;
+extern my_bool opt_encrypted_backup;
extern my_bool opt_lock_ddl_per_table;
extern char *opt_incremental_history_name;
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index d47638ad2f9..1eb07a2adf8 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -34,7 +34,7 @@ ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
COMPONENT Test)
-TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcre pcreposix)
+TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcreposix pcre)
IF(CMAKE_GENERATOR MATCHES "Xcode")
# It does not seem possible to tell Xcode the resulting target might need
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 9c34ede59c7..1ac4931fdf1 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -25,7 +25,6 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
resolveip.1 mariadb-service-convert.1
mysqld_safe_helper.1 tokuftdump.1 wsrep_sst_common.1
wsrep_sst_mysqldump.1 wsrep_sst_rsync.1
- wsrep_sst_xtrabackup-v2.1 wsrep_sst_xtrabackup.1
galera_recovery.1 galera_new_cluster.1 tokuft_logprint.1
mysql_ldb.1
wsrep_sst_mariabackup.1 mbstream.1 mariabackup.1
diff --git a/man/wsrep_sst_xtrabackup-v2.1 b/man/wsrep_sst_xtrabackup-v2.1
deleted file mode 100644
index c8dde2f0640..00000000000
--- a/man/wsrep_sst_xtrabackup-v2.1
+++ /dev/null
@@ -1,18 +0,0 @@
-'\" t
-.\"
-.TH "\FBWSREP_SST_XTRABACKUP-V2\FR" "1" "9 May 2017" "MariaDB 10\&.3" "MariaDB Database System"
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.SH NAME
-wsrep_sst_xtrabackup-v2 \- xtrabackup\-based state snapshot transfer
-.SH DESCRIPTION
-Use: xtrabackup-based state snapshot transfer\.
-.PP
-Note that the xtrabackup-v2 method is deprecated after version 10\.1, with newer versions you should use mariabackup instead\.
-.PP
-For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/man/wsrep_sst_xtrabackup.1 b/man/wsrep_sst_xtrabackup.1
deleted file mode 100644
index 1fe5037d8b7..00000000000
--- a/man/wsrep_sst_xtrabackup.1
+++ /dev/null
@@ -1,18 +0,0 @@
-'\" t
-.\"
-.TH "\FBWSREP_SST_XTRABACKUP\FR" "1" "9 May 2017" "MariaDB 10\&.3" "MariaDB Database System"
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.SH NAME
-wsrep_sst_xtrabackup \- xtrabackup\-based state snapshot transfer
-.SH DESCRIPTION
-Use: xtrabackup-based state snapshot transfer\.
-.PP
-Note that the xtrabackup method is deprecated after version 10\.1, with newer versions you should use mariabackup instead\.
-.PP
-For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result
index 459ec286165..89e10d221d2 100644
--- a/mysql-test/main/connect.result
+++ b/mysql-test/main/connect.result
@@ -101,6 +101,14 @@ connect fail_con,localhost,test,zorro,;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
update mysql.user set plugin="", authentication_string="", password=old_password("gambling2") where user=_binary"test";
flush privileges;
+show grants for test@localhost;
+Grants for test@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
+update mysql.user set plugin='mysql_old_password' where user='test';
+flush privileges;
+show grants for test@localhost;
+Grants for test@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
connect con10,localhost,test,gambling2,;
connect con5,localhost,test,gambling2,mysql;
set password="";
diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test
index afc0fcc1259..b0461a5afac 100644
--- a/mysql-test/main/connect.test
+++ b/mysql-test/main/connect.test
@@ -65,6 +65,10 @@ connect (fail_con,localhost,test,zorro,);
source include/switch_to_mysql_user.inc;
update mysql.user set plugin="", authentication_string="", password=old_password("gambling2") where user=_binary"test";
flush privileges;
+show grants for test@localhost;
+update mysql.user set plugin='mysql_old_password' where user='test';
+flush privileges;
+show grants for test@localhost;
connect (con10,localhost,test,gambling2,);
connect (con5,localhost,test,gambling2,mysql);
diff --git a/mysql-test/main/huge_frm-6224.result b/mysql-test/main/huge_frm-6224.result
index 3772317c04d..bbb650bc5b4 100644
--- a/mysql-test/main/huge_frm-6224.result
+++ b/mysql-test/main/huge_frm-6224.result
@@ -1 +1,6 @@
+set global max_allowed_packet=1024*1024*10;
+connect con1,localhost,root;
ERROR HY000: The definition for table `t1` is too big
+connection default;
+disconnect con1;
+set global max_allowed_packet=default;
diff --git a/mysql-test/main/huge_frm-6224.test b/mysql-test/main/huge_frm-6224.test
index 418722a7b51..322abd01738 100644
--- a/mysql-test/main/huge_frm-6224.test
+++ b/mysql-test/main/huge_frm-6224.test
@@ -4,17 +4,24 @@
# verify that huge frms are rejected during creation, not on opening
#
--source include/have_partition.inc
+set global max_allowed_packet=1024*1024*10;
+connect con1,localhost,root;
-let $n=5646;
+let $n=8164;
let $a=create table t1 (a int) engine=myisam partition by hash(a) partitions $n (;
dec $n;
while ($n)
{
- let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n,;
+ let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n COMMENT 'partition p01234567890123456789012345678901234567890123456789012345678$n',;
dec $n;
}
--disable_query_log
--error ER_TABLE_DEFINITION_TOO_BIG
eval $a partition foo);
+--enable_query_log
+
+connection default;
+disconnect con1;
+set global max_allowed_packet=default;
diff --git a/mysql-test/main/mysqlbinlog_row_compressed.result b/mysql-test/main/mysqlbinlog_row_compressed.result
index cbea1cf9def..8cf52f5b826 100644
--- a/mysql-test/main/mysqlbinlog_row_compressed.result
+++ b/mysql-test/main/mysqlbinlog_row_compressed.result
@@ -61,7 +61,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "")
#<date> server id 1 end_log_pos 899 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 899
-#<date> server id 1 end_log_pos 967 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 967 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -90,7 +90,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL)
#<date> server id 1 end_log_pos 1214 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1214
-#<date> server id 1 end_log_pos 1281 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 1281 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=11 /* INT meta=0 nullable=0 is_null=0 */
@@ -119,7 +119,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A")
#<date> server id 1 end_log_pos 1530 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1530
-#<date> server id 1 end_log_pos 1596 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 1596 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=12 /* INT meta=0 nullable=0 is_null=0 */
@@ -148,7 +148,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A")
#<date> server id 1 end_log_pos 1842 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1842
-#<date> server id 1 end_log_pos 1909 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 1909 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
@@ -177,7 +177,7 @@ BEGIN
#Q> INSERT INTO t2 SELECT * FROM t1
#<date> server id 1 end_log_pos 2134 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 2134
-#<date> server id 1 end_log_pos 2225 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 2225 CRC32 XXX Write_compressed_rows: table id 33 flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -239,7 +239,7 @@ BEGIN
#Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL
#<date> server id 1 end_log_pos 2462 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 2462
-#<date> server id 1 end_log_pos 2561 CRC32 XXX Update_compressed_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 2561 CRC32 XXX Update_compressed_rows: table id 33 flags: STMT_END_F
### UPDATE `test`.`t2`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -320,7 +320,7 @@ BEGIN
#Q> DELETE FROM t1
#<date> server id 1 end_log_pos 2769 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 2769
-#<date> server id 1 end_log_pos 2861 CRC32 XXX Delete_compressed_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 2861 CRC32 XXX Delete_compressed_rows: table id 32 flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -382,7 +382,7 @@ BEGIN
#Q> DELETE FROM t2
#<date> server id 1 end_log_pos 3069 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 3069
-#<date> server id 1 end_log_pos 3154 CRC32 XXX Delete_compressed_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 3154 CRC32 XXX Delete_compressed_rows: table id 33 flags: STMT_END_F
### DELETE FROM `test`.`t2`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
diff --git a/mysql-test/main/mysqlbinlog_row_minimal.result b/mysql-test/main/mysqlbinlog_row_minimal.result
index 6417a528638..680fd8196a8 100644
--- a/mysql-test/main/mysqlbinlog_row_minimal.result
+++ b/mysql-test/main/mysqlbinlog_row_minimal.result
@@ -59,7 +59,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "")
#<date> server id 1 end_log_pos 946 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 946
-#<date> server id 1 end_log_pos 1015 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 1015 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -88,7 +88,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL)
#<date> server id 1 end_log_pos 1262 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1262
-#<date> server id 1 end_log_pos 1330 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 1330 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=11 /* INT meta=0 nullable=0 is_null=0 */
@@ -117,7 +117,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A")
#<date> server id 1 end_log_pos 1579 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1579
-#<date> server id 1 end_log_pos 1646 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 1646 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=12 /* INT meta=0 nullable=0 is_null=0 */
@@ -146,7 +146,7 @@ BEGIN
#Q> INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A")
#<date> server id 1 end_log_pos 1892 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1892
-#<date> server id 1 end_log_pos 1962 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 1962 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
@@ -175,7 +175,7 @@ BEGIN
#Q> INSERT INTO t2 SELECT * FROM t1
#<date> server id 1 end_log_pos 2187 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 2187
-#<date> server id 1 end_log_pos 2354 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 2354 CRC32 XXX Write_rows: table id 33 flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -237,7 +237,7 @@ BEGIN
#Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL
#<date> server id 1 end_log_pos 2591 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 2591
-#<date> server id 1 end_log_pos 2665 CRC32 XXX Update_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 2665 CRC32 XXX Update_rows: table id 33 flags: STMT_END_F
### UPDATE `test`.`t2`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -273,7 +273,7 @@ BEGIN
#Q> DELETE FROM t1
#<date> server id 1 end_log_pos 2873 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 2873
-#<date> server id 1 end_log_pos 2927 CRC32 XXX Delete_rows: table id 31 flags: STMT_END_F
+#<date> server id 1 end_log_pos 2927 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -303,7 +303,7 @@ BEGIN
#Q> DELETE FROM t2
#<date> server id 1 end_log_pos 3135 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 3135
-#<date> server id 1 end_log_pos 3189 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 3189 CRC32 XXX Delete_rows: table id 33 flags: STMT_END_F
### DELETE FROM `test`.`t2`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
diff --git a/mysql-test/main/range_innodb.result b/mysql-test/main/range_innodb.result
index ae25adf1a19..30161a2711d 100644
--- a/mysql-test/main/range_innodb.result
+++ b/mysql-test/main/range_innodb.result
@@ -56,3 +56,27 @@ pk f1 f2 f3 pk f1 f2 f3 f4 f5
2 6 v NULL 14 1 q NULL 4 q
3 7 c NULL 14 1 q NULL 4 q
drop table t1,t2;
+#
+# MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND'
+# failed in handler::ha_rnd_end upon SELECT from partitioned table
+#
+set @optimizer_switch_save= @@optimizer_switch;
+set optimizer_switch='index_merge_sort_intersection=off';
+create table t0 (a int)engine=innodb;
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+a int, b int, c int,
+key(a),key(b),key(c)
+)engine=innodb;
+insert into t1
+select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
+from t0 A, t0 B, t0 C, t0 D where D.a<5;
+set @@global.debug_dbug="+d,ha_index_init_fail";
+explain select * from t1 where a=10 and b=10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where
+select * from t1 where a=10 and b=10;
+ERROR HY000: Table definition has changed, please retry transaction
+DROP TABLE t0,t1;
+set @@global.debug_dbug="-d";
+set @@optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test
index 605006587cc..a17ef3f1146 100644
--- a/mysql-test/main/range_innodb.test
+++ b/mysql-test/main/range_innodb.test
@@ -3,6 +3,7 @@
--echo #
--source include/have_innodb.inc
+--source include/have_debug.inc
--disable_warnings
drop table if exists t0, t1, t2;
@@ -62,3 +63,27 @@ INSERT INTO t2 VALUES (4,'q'),(NULL,'j');
SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2
WHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 );
drop table t1,t2;
+
+--echo #
+--echo # MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND'
+--echo # failed in handler::ha_rnd_end upon SELECT from partitioned table
+--echo #
+
+set @optimizer_switch_save= @@optimizer_switch;
+set optimizer_switch='index_merge_sort_intersection=off';
+create table t0 (a int)engine=innodb;
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+ a int, b int, c int,
+ key(a),key(b),key(c)
+)engine=innodb;
+insert into t1
+select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
+from t0 A, t0 B, t0 C, t0 D where D.a<5;
+set @@global.debug_dbug="+d,ha_index_init_fail";
+explain select * from t1 where a=10 and b=10;
+--error ER_TABLE_DEF_CHANGED
+select * from t1 where a=10 and b=10;
+DROP TABLE t0,t1;
+set @@global.debug_dbug="-d";
+set @@optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 428092a355a..56e265d9eef 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -5343,6 +5343,7 @@ sub server_need_restart {
{
delete $server->{'restart_opts'};
my $use_dynamic_option_switch= 0;
+ delete $server->{'restart_opts'};
if (!$use_dynamic_option_switch)
{
mtr_verbose_restart($server, "running with different options '" .
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index b179c9d2a63..76f62e7b0eb 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -27,12 +27,10 @@ MW-416 : MDEV-13549 Galera test failures
MW-388 : MDEV-13549 Galera test failures
MW-44 : MDEV-15809 Test failure on galera.MW-44
galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
-galera_drop_database : MDEV-17421 mtr does not restart the server whose parameters were changed
galera_kill_applier : race condition at the start of the test
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
pxc-421: Lock timeout exceeded
galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure
-galera_sst_xtrabackup-v2-options : Failed to read uuid:seqno and wsrep_gtid_domain_id from joiner script
galera_gcs_fc_limit : Timeouts
pool_of_threads: WSREP has not yet prepared node for application use
galera_var_innodb_disallow_writes : Timeout
diff --git a/mysql-test/suite/galera/r/galera_drop_database.result b/mysql-test/suite/galera/r/galera_drop_database.result
index 79789da5a11..b39593752e1 100644
--- a/mysql-test/suite/galera/r/galera_drop_database.result
+++ b/mysql-test/suite/galera/r/galera_drop_database.result
@@ -1,3 +1,7 @@
+connection node_1;
+connection node_2;
+connection node_1;
+connection node_2;
CREATE DATABASE fts;
USE fts;
CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
@@ -9,6 +13,10 @@ INSERT INTO fts_t2 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
DROP TABLE ten;
UPDATE fts_t1 SET f2 = 'abcd';
UPDATE fts_t2 SET f2 = 'efjh';
+connection node_2;
+connection node_1;
+connection node_2;
+connection node_1;
USE fts;
DROP TABLE fts_t1;
DROP TABLE fts_t2;
diff --git a/mysql-test/suite/galera/t/galera_drop_database.test b/mysql-test/suite/galera/t/galera_drop_database.test
index 47fe8315198..12d9efea2f9 100644
--- a/mysql-test/suite/galera/t/galera_drop_database.test
+++ b/mysql-test/suite/galera/t/galera_drop_database.test
@@ -9,6 +9,7 @@
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
+# Create test database with two sets of the FTS indexes:
CREATE DATABASE fts;
USE fts;
CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB;
@@ -23,34 +24,19 @@ DROP TABLE ten;
UPDATE fts_t1 SET f2 = 'abcd';
UPDATE fts_t2 SET f2 = 'efjh';
+# Restart the second node:
--connection node_2
-let $wsrep_cluster_address = `SELECT @@global.wsrep_node_incoming_address`;
--source include/restart_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
---let $galera_connection_name = node_2a
---let $galera_server_number = 2
---source include/galera_connect.inc
---connection node_2a
+--connection node_2
--source include/wait_until_ready.inc
+# Drop the tables and database after nodes restarted:
--connection node_1
---let $restart_parameters = --wsrep-cluster-address=gcomm://$wsrep_cluster_address
---source include/restart_mysqld.inc
-
---connection node_2a
---let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
---source include/wait_condition.inc
-
---let $galera_connection_name = node_1a
---let $galera_server_number = 1
---source include/galera_connect.inc
---connection node_1a
---source include/wait_until_ready.inc
-
USE fts;
DROP TABLE fts_t1;
DROP TABLE fts_t2;
@@ -58,8 +44,4 @@ SHOW TABLES;
DROP DATABASE fts;
# Restore original auto_increment_offset values.
---let $node_1=node_1a
---let $node_2=node_2a
--source include/auto_increment_offset_restore.inc
-
---source include/galera_end.inc
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index e640baebf7d..1683485981b 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -1,4 +1,2 @@
galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798
-galera_innobackupex_backup : xtrabackup is deprecated
-galera_ipv6_xtrabackup-v2 : xtrabackup is deprecated
diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
index 39a68d2be41..2707fb69f4d 100644
--- a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
+++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
@@ -22,7 +22,7 @@ wsrep_node_address=127.0.0.1
#sst_port=@OPT.port
wsrep-on=1
wsrep-cluster-address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
@@ -34,7 +34,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
@@ -46,7 +46,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
@@ -60,7 +60,7 @@ wsrep_cluster_name=cluster2
#sst_port=@OPT.port
wsrep-on=1
wsrep-cluster-address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
@@ -73,7 +73,7 @@ wsrep_cluster_name=cluster2
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
-wsrep_provider_options='base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.5.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.5.port
@@ -86,7 +86,7 @@ wsrep_cluster_name=cluster2
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
-wsrep_provider_options='base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.6.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port
diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
index 708902fd7e7..ab7493e313b 100644
--- a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
+++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
@@ -19,7 +19,7 @@ wsrep-sync-wait=15
#wsrep-new-cluster
wsrep-on=1
wsrep-cluster-address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
@@ -31,7 +31,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
@@ -43,7 +43,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
diff --git a/mysql-test/suite/galera_3nodes/include/have_mariabackup.inc b/mysql-test/suite/galera_3nodes/include/have_mariabackup.inc
new file mode 100644
index 00000000000..0dd693f2c63
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/include/have_mariabackup.inc
@@ -0,0 +1,4 @@
+#
+# suite.pm will make sure that all tests including this file
+# will be skipped as needed
+#
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup.result
new file mode 100644
index 00000000000..5665ed5f46a
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup.result
@@ -0,0 +1,22 @@
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+connection node_2;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+connection node_2;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+connection node_1;
+include/assert_grep.inc [Streaming the backup to joiner at \[::1\]]
+include/assert_grep.inc [async IST sender starting to serve tcp://\[::1\]:]
+include/assert_grep.inc [IST receiver addr using tcp://\[::1\]]
+include/assert_grep.inc [Prepared IST receiver, listening at: tcp://\[::1\]]
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result
index a977f784e54..3564dc8c5a1 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result
@@ -1,6 +1,5 @@
-connection node_2;
-connection node_1;
-connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to'");
+call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
connection node_1;
connection node_2;
connection node_3;
@@ -10,14 +9,13 @@ GRANT ALL PRIVILEGES ON *.* TO 'sst';
SET GLOBAL wsrep_sst_auth = 'sst:';
connection node_2;
SET GLOBAL wsrep_sst_method = 'mysqldump';
-connection node_2;
-Unloading wsrep provider ...
-SET GLOBAL wsrep_provider = 'none';
+Shutting down server ...
connection node_1;
+Cleaning var directory ...
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
-Loading wsrep provider ...
+Starting server ...
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
@@ -35,6 +33,5 @@ CALL mtr.add_suppression("Can't open and lock time zone table");
CALL mtr.add_suppression("Can't open and lock privilege tables");
CALL mtr.add_suppression("Info table is not ready to be used");
CALL mtr.add_suppression("Native table .* has the wrong structure");
-CALL mtr.add_suppression("Table \'mysql.gtid_slave_pos\' doesn\'t exist");
connection node_2;
CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort");
diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm
index 03eeeeaf057..9882793cb20 100644
--- a/mysql-test/suite/galera_3nodes/suite.pm
+++ b/mysql-test/suite/galera_3nodes/suite.pm
@@ -21,14 +21,21 @@ $ENV{WSREP_PROVIDER} = $provider;
my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
return "No SST scripts" unless $spath;
+my ($cpath) = grep { -f "$_/mysql"; } "$::bindir/scripts", $::path_client_bindir;
+return "No scritps" unless $cpath;
+
my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
return "No my_print_defaults" unless $epath;
+my ($bpath) = grep { -f "$_/mariabackup"; } "$::bindir/extra/mariabackup", $::path_client_bindir;
+
+sub which($) { return `sh -c "command -v $_[0]"` }
+
push @::global_suppressions,
(
qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1),
- qr(WSREP: Could not open saved state file for reading: ),
- qr(WSREP: Could not open state file for reading: ),
+ qr(WSREP: Could not open saved state file for reading: .*),
+ qr(WSREP: Could not open state file for reading: .*),
qr(WSREP: Gap in state sequence. Need state transfer.),
qr(WSREP: Failed to prepare for incremental state transfer:),
qr(WSREP:.*down context.*),
@@ -42,16 +49,43 @@ push @::global_suppressions,
qr|WSREP: discarding established \(time wait\) .*|,
qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.),
qr(WSREP: evs::proto.*),
- qr|WSREP: Ignoring possible split-brain (allowed by configuration) from view:.*|,
+ qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|,
qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable),
+ qr(WSREP: .* sending install message failed: Transport endpoint is not connected),
+ qr(WSREP: .* sending install message failed: Resource temporarily unavailable),
qr(WSREP: Could not find peer:),
- qr(WSREP: Protocol violation. JOIN message sender .*),
- qr(WSREP: JOIN message from member [0-9]* in non-primary configuration. Ignored.),
+ qr|WSREP: gcs_caused\(\) returned .*|,
+ qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|,
+ qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|,
+ qr(WSREP: Action message in non-primary configuration from member [0-9]*),
+ qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on),
+ qr(WSREP: JOIN message from member .* in non-primary configuration. Ignored.),
);
$ENV{PATH}="$epath:$ENV{PATH}";
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
+$ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath;
+$ENV{PATH}="$bpath:$ENV{PATH}" unless $bpath eq $spath;
+
+if (which(socat)) {
+ $ENV{MTR_GALERA_TFMT}='socat';
+} elsif (which(nc)) {
+ $ENV{MTR_GALERA_TFMT}='nc';
+}
+
+sub skip_combinations {
+ my %skip = ();
+ $skip{'include/have_filekeymanagement.inc'} = 'needs file_key_management plugin'
+ unless $ENV{FILE_KEY_MANAGEMENT_SO};
+ $skip{'include/have_mariabackup.inc'} = 'Need mariabackup'
+ unless which(mariabackup);
+ $skip{'include/have_mariabackup.inc'} = 'Need ss'
+ unless which(ss);
+ $skip{'include/have_mariabackup.inc'} = 'Need socat or nc'
+ unless $ENV{MTR_GALERA_TFMT};
+ %skip;
+}
bless { };
diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf
new file mode 100644
index 00000000000..35ecb8b5937
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf
@@ -0,0 +1,4 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep-causal-reads=OFF
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf
new file mode 100644
index 00000000000..5ac00fa056b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf
@@ -0,0 +1,29 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+wsrep_node_address=::1
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
+
+[SST]
+transferfmt=@ENV.MTR_GALERA_TFMT
+streamfmt=xbstream
+sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt
new file mode 100644
index 00000000000..c2bb4d156af
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt
@@ -0,0 +1 @@
+--bind-address=::
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test
new file mode 100644
index 00000000000..fdf70989d5d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test
@@ -0,0 +1,59 @@
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+--source include/have_mariabackup.inc
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Force IST
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+# Confirm that key messages around SST and IST reference IPv6
+
+--connection node_1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST
+
+--let $assert_count = 2
+--let $assert_text = Streaming the backup to joiner at \[::1\]
+--let $assert_select = Streaming the backup to joiner at \[::1\]
+--source include/assert_grep.inc
+
+--let $assert_count = 1
+--let $assert_text = async IST sender starting to serve tcp://\[::1\]:
+--let $assert_select = async IST sender starting to serve tcp://\[::1\]:
+--source include/assert_grep.inc
+
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+
+--let $assert_text = IST receiver addr using tcp://\[::1\]
+--let $assert_select = IST receiver addr using tcp://\[::1\]
+--source include/assert_grep.inc
+
+--let $assert_text = Prepared IST receiver, listening at: tcp://\[::1\]
+--let $assert_select = Prepared IST receiver, listening at: tcp://\[::1\]
+--source include/assert_grep.inc
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
index 3728e1ce005..80dd0c41cc3 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
@@ -2,21 +2,25 @@
[mysqld]
wsrep_sst_method=rsync
+wsrep_node_address=::1
[mysqld.1]
wsrep-cluster-address=gcomm://
-wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
+
+[SST]
+sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt
index 215293eccec..c2bb4d156af 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt
@@ -1 +1 @@
---bind-address=*
+--bind-address=::
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test
index 93050b54f5d..cddef6ccdbd 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test
@@ -8,6 +8,19 @@
--let $node_3=node_3
--source ../galera/include/auto_increment_offset_save.inc
+call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to'");
+call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--let $node_3=node_3
+--source ../galera/include/auto_increment_offset_save.inc
+
--connection node_1
CREATE USER 'sst';
GRANT ALL PRIVILEGES ON *.* TO 'sst';
@@ -25,25 +38,37 @@ SET GLOBAL wsrep_sst_auth = 'sst:';
--enable_query_log
SET GLOBAL wsrep_sst_method = 'mysqldump';
-
#
# Force mysqldump SST
#
---connection node_2
---source suite/galera/include/galera_unload_provider.inc
---remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+#--connection node_2
+#--source suite/galera/include/galera_unload_provider.inc
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
+--echo Cleaning var directory ...
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
+
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
-
--connection node_2
---source suite/galera/include/galera_load_provider.inc
+--echo Starting server ...
+--let $start_mysqld_params = --wsrep_sst_auth=sst: --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=[::1].1:$NODE_MYPORT_2
+--source include/start_mysqld.inc
+
+#--source suite/galera/include/galera_load_provider.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
@@ -67,3 +92,6 @@ SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE
--source suite/galera/include/galera_sst_restore.inc
--connection node_2
CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort");
+
+# Restore original auto_increment_offset values.
+--source ../galera/include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
index 3728e1ce005..80dd0c41cc3 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
@@ -2,21 +2,25 @@
[mysqld]
wsrep_sst_method=rsync
+wsrep_node_address=::1
[mysqld.1]
wsrep-cluster-address=gcomm://
-wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
+
+[SST]
+sockopt=",pf=ip6"
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt
new file mode 100644
index 00000000000..c2bb4d156af
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt
@@ -0,0 +1 @@
+--bind-address=::
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result
index 25faeaf4e84..1d4766eab19 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result
@@ -7,9 +7,18 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb;
CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL,
fld3 INT AS (fld2) VIRTUAL, KEY(fld1),
FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb;
+CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB;
+CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb),
+FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB;
+INSERT INTO u1 SET a=1;
+INSERT INTO u2 SET b=1;
INSERT INTO t1(fld1) VALUES(1);
INSERT INTO t2(fld1, fld2) VALUES(1, 2);
UPDATE t1 SET fld1= 2;
+DELETE FROM u1;
+SELECT * FROM u2;
+b vb
+DROP TABLE u2,u1;
SELECT fld3, fld1 FROM t2;
fld3 fld1
2 2
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result
index bde9f086eac..6913ec698b4 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_index.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result
@@ -239,3 +239,23 @@ KEY (a(1))
INSERT INTO t1(b) VALUES(REPEAT('b',1000));
DELETE FROM t1;
DROP TABLE t1;
+#
+# Bug #22990029 GCOLS: INCORRECT BEHAVIOR
+# AFTER DATA INSERTED WITH IGNORE KEYWORD
+#
+CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb))
+ENGINE=InnoDB;
+INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132);
+Warnings:
+Warning 1265 Data truncated for column 'vb' at row 1
+BEGIN;
+DELETE FROM t1;
+INSERT INTO t1 (a,b) VALUES(1,20190123);
+ERROR 22007: Incorrect date value: '20190132' for column `test`.`t1`.`vb` at row 1
+SELECT * FROM t1;
+a b vb
+ROLLBACK;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test
index 61d330036ea..45d1c1295a5 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test
@@ -11,10 +11,19 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb;
CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL,
fld3 INT AS (fld2) VIRTUAL, KEY(fld1),
FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb;
+CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB;
+CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb),
+ FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB;
+
+INSERT INTO u1 SET a=1;
+INSERT INTO u2 SET b=1;
INSERT INTO t1(fld1) VALUES(1);
INSERT INTO t2(fld1, fld2) VALUES(1, 2);
--source include/restart_mysqld.inc
UPDATE t1 SET fld1= 2;
+DELETE FROM u1;
+SELECT * FROM u2;
+DROP TABLE u2,u1;
SELECT fld3, fld1 FROM t2;
alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM=INPLACE;
UPDATE t1 SET fld1=3;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test
index 8f4e09fdf31..a89ae813b05 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_index.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test
@@ -263,3 +263,22 @@ CREATE TABLE t1(
INSERT INTO t1(b) VALUES(REPEAT('b',1000));
DELETE FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # Bug #22990029 GCOLS: INCORRECT BEHAVIOR
+--echo # AFTER DATA INSERTED WITH IGNORE KEYWORD
+--echo #
+
+CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb))
+ENGINE=InnoDB;
+INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132);
+BEGIN;
+DELETE FROM t1;
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 (a,b) VALUES(1,20190123);
+SELECT * FROM t1;
+ROLLBACK;
+# MDEV-18366 FIXME: fix the crash and enable this
+# SELECT * FROM t1;
+CHECK TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/alter_candidate_key.result b/mysql-test/suite/innodb/r/alter_candidate_key.result
new file mode 100644
index 00000000000..23989e0da5f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_candidate_key.result
@@ -0,0 +1,114 @@
+CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL,
+UNIQUE KEY uidx2(f1,f2),
+UNIQUE KEY uidx1(f2)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL,
+ UNIQUE KEY `uidx2` (`f1`,`f2`),
+ UNIQUE KEY `uidx1` (`f2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
+ SIGNAL conc_dml WAIT_FOR go_ahead';
+ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE;
+connect con1,localhost,root,,;
+SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
+DELETE FROM t1;
+SET DEBUG_SYNC = 'now SIGNAL go_ahead';
+connection default;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f11` int(11) DEFAULT NULL,
+ `f2` int(11) NOT NULL,
+ UNIQUE KEY `uidx1` (`f2`),
+ UNIQUE KEY `uidx2` (`f11`,`f2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT, f2 INT,
+PRIMARY KEY(f1, f2),
+UNIQUE INDEX uidx2 (f1, f2),
+UNIQUE INDEX uidx1 (f2))ENGINE=InnoDB;
+ALTER TABLE t1 DROP PRIMARY KEY;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL,
+ UNIQUE KEY `uidx2` (`f1`,`f2`),
+ UNIQUE KEY `uidx1` (`f2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
+ SIGNAL conc_dml WAIT_FOR go_ahead';
+ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE;
+connection con1;
+SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
+INSERT INTO t1 VALUES(1, 1), (1, 1);
+ERROR 23000: Duplicate entry '1-1' for key 'uidx2'
+SET DEBUG_SYNC = 'now SIGNAL go_ahead';
+connection default;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f11` int(11) DEFAULT NULL,
+ `f2` int(11) NOT NULL,
+ UNIQUE KEY `uidx1` (`f2`),
+ UNIQUE KEY `uidx2` (`f11`,`f2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+SET SQL_MODE= strict_trans_tables;
+CREATE TABLE t1(a INT UNIQUE) ENGINE=InnoDB;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
+ALTER TABLE t1 MODIFY COLUMN a INT NOT NULL;
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR dml';
+BEGIN;
+INSERT INTO t1 SET a=NULL;
+ROLLBACK;
+set DEBUG_SYNC='now SIGNAL dml_done';
+connection default;
+ERROR 22004: Invalid use of NULL value
+DROP TABLE t1;
+disconnect con1;
+SET DEBUG_SYNC="RESET";
+SET SQL_MODE=DEFAULT;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY(f1, f2),
+UNIQUE KEY(f2))ENGINE=InnoDB;
+ALTER TABLE t1 DROP PRIMARY KEY;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL,
+ UNIQUE KEY `f2` (`f2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+UNIQUE KEY(f2), UNIQUE KEY(f2))ENGINE=InnoDB;
+Warnings:
+Note 1831 Duplicate index `f2_2`. This is deprecated and will be disallowed in a future release
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL,
+ UNIQUE KEY `f2` (`f2`),
+ UNIQUE KEY `f2_2` (`f2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` int(11) NOT NULL,
+ UNIQUE KEY `f2_2` (`f2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index a23d3593dce..09e4da28564 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -1571,6 +1571,7 @@ create table t1(f1 int not null, f2 int not null,
primary key (f1), unique key(f1, f2))engine=innodb;
insert into t1 values(1,3), (2,2);
alter table t1 drop primary key, lock=none;
+alter table t1 drop index f1, lock=none;
ERROR 0A000: LOCK=NONE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try LOCK=SHARED
drop table t1;
#
diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result
index 1cfa342c63f..363ca07e1bc 100644
--- a/mysql-test/suite/innodb/r/innodb-table-online.result
+++ b/mysql-test/suite/innodb/r/innodb-table-online.result
@@ -99,17 +99,6 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `c2` (`c2`),
UNIQUE KEY `c2_2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
-ALTER TABLE t1 DROP INDEX c2, ALGORITHM = INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL,
- `c2` int(11) NOT NULL,
- `c3` char(255) NOT NULL,
- UNIQUE KEY `c2` (`c2`),
- UNIQUE KEY `c2_2` (`c2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
ALTER TABLE t1 DROP INDEX c2, ADD PRIMARY KEY(c1);
# session default
connection default;
diff --git a/mysql-test/suite/innodb/r/innodb_28867993.result b/mysql-test/suite/innodb/r/innodb_28867993.result
new file mode 100644
index 00000000000..acc6734eaee
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_28867993.result
@@ -0,0 +1,9 @@
+create table t1 (a int) engine=innodb;
+insert t1 values (1),(2);
+create database ib_logfile2;
+select * from t1;
+a
+1
+2
+drop table t1;
+drop database ib_logfile2;
diff --git a/mysql-test/suite/innodb/t/alter_candidate_key.test b/mysql-test/suite/innodb/t/alter_candidate_key.test
new file mode 100644
index 00000000000..7429cd89a1a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_candidate_key.test
@@ -0,0 +1,72 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL,
+ UNIQUE KEY uidx2(f1,f2),
+ UNIQUE KEY uidx1(f2)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1);
+SHOW CREATE TABLE t1;
+SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
+ SIGNAL conc_dml WAIT_FOR go_ahead';
+--send ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE
+connect (con1,localhost,root,,);
+SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
+DELETE FROM t1;
+SET DEBUG_SYNC = 'now SIGNAL go_ahead';
+connection default;
+reap;
+SHOW CREATE TABLE t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT, f2 INT,
+ PRIMARY KEY(f1, f2),
+ UNIQUE INDEX uidx2 (f1, f2),
+ UNIQUE INDEX uidx1 (f2))ENGINE=InnoDB;
+ALTER TABLE t1 DROP PRIMARY KEY;
+SHOW CREATE TABLE t1;
+SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter
+ SIGNAL conc_dml WAIT_FOR go_ahead';
+--send ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE
+connection con1;
+SET DEBUG_SYNC = 'now WAIT_FOR conc_dml';
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES(1, 1), (1, 1);
+SET DEBUG_SYNC = 'now SIGNAL go_ahead';
+connection default;
+reap;
+SHOW CREATE TABLE t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+
+SET SQL_MODE= strict_trans_tables;
+CREATE TABLE t1(a INT UNIQUE) ENGINE=InnoDB;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
+--send ALTER TABLE t1 MODIFY COLUMN a INT NOT NULL
+connection con1;
+SET DEBUG_SYNC='now WAIT_FOR dml';
+BEGIN;
+INSERT INTO t1 SET a=NULL;
+ROLLBACK;
+set DEBUG_SYNC='now SIGNAL dml_done';
+connection default;
+--error ER_INVALID_USE_OF_NULL
+reap;
+DROP TABLE t1;
+disconnect con1;
+SET DEBUG_SYNC="RESET";
+SET SQL_MODE=DEFAULT;
+
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY(f1, f2),
+ UNIQUE KEY(f2))ENGINE=InnoDB;
+ALTER TABLE t1 DROP PRIMARY KEY;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+ UNIQUE KEY(f2), UNIQUE KEY(f2))ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 53f87cb78d5..bfbe62699fd 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -905,8 +905,9 @@ drop table t1;
create table t1(f1 int not null, f2 int not null,
primary key (f1), unique key(f1, f2))engine=innodb;
insert into t1 values(1,3), (2,2);
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t1 drop primary key, lock=none;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t1 drop index f1, lock=none;
drop table t1;
--echo #
diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test
index edf83247142..2b3879bc707 100644
--- a/mysql-test/suite/innodb/t/innodb-table-online.test
+++ b/mysql-test/suite/innodb/t/innodb-table-online.test
@@ -102,10 +102,6 @@ ALTER TABLE t1 ADD UNIQUE INDEX(c2),
LOCK = EXCLUSIVE, ALGORITHM = INPLACE;
SHOW CREATE TABLE t1;
-# We do not support plain DROP_PK_INDEX without ADD_PK_INDEX.
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE t1 DROP INDEX c2, ALGORITHM = INPLACE;
-SHOW CREATE TABLE t1;
# Now the previous DEBUG_SYNC should kick in.
--send
ALTER TABLE t1 DROP INDEX c2, ADD PRIMARY KEY(c1);
diff --git a/mysql-test/suite/innodb/t/innodb_28867993.test b/mysql-test/suite/innodb/t/innodb_28867993.test
new file mode 100644
index 00000000000..61e9578df7b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_28867993.test
@@ -0,0 +1,12 @@
+#
+# Bug#28867993: POSSIBLE ISSUE WITH MYSQL SERVER RESTART
+#
+
+source include/have_innodb.inc;
+create table t1 (a int) engine=innodb;
+insert t1 values (1),(2);
+create database ib_logfile2;
+source include/restart_mysqld.inc;
+select * from t1;
+drop table t1;
+drop database ib_logfile2;
diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff
new file mode 100644
index 00000000000..0849c5dcf64
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff
@@ -0,0 +1,31 @@
+--- r/rpl_row_big_table_id.result 2019-01-23 19:58:07.204914873 +0200
++++ r/rpl_row_big_table_id_32bit.result 2019-01-23 19:43:54.590640934 +0200
+@@ -22,22 +22,22 @@
+ master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
+ master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
+ master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 1
+-master-bin.000002 # Table_map 1 # table_id: 4294967295 (test.t)
+-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967295 flags: STMT_END_F
++master-bin.000002 # Table_map 1 # table_id: 1 (test.t)
++master-bin.000002 # Write_rows_v1 1 # table_id: 1 flags: STMT_END_F
+ master-bin.000002 # Query 1 # COMMIT
+ master-bin.000002 # Gtid 1 # GTID #-#-#
+ master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
+ master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
+ master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 2
+-master-bin.000002 # Table_map 1 # table_id: 4294967296 (test.t)
+-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967296 flags: STMT_END_F
++master-bin.000002 # Table_map 1 # table_id: 2 (test.t)
++master-bin.000002 # Write_rows_v1 1 # table_id: 2 flags: STMT_END_F
+ master-bin.000002 # Query 1 # COMMIT
+ master-bin.000002 # Gtid 1 # GTID #-#-#
+ master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
+ master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
+ master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 3
+-master-bin.000002 # Table_map 1 # table_id: 4294967297 (test.t)
+-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967297 flags: STMT_END_F
++master-bin.000002 # Table_map 1 # table_id: 3 (test.t)
++master-bin.000002 # Write_rows_v1 1 # table_id: 3 flags: STMT_END_F
+ master-bin.000002 # Query 1 # COMMIT
+ connection slave;
+ connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id.result b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result
new file mode 100644
index 00000000000..7a0a964dc5e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result
@@ -0,0 +1,46 @@
+include/master-slave.inc
+[connection master]
+connection master;
+include/rpl_restart_server.inc [server_number=1]
+SET @@debug_dbug="d,simulate_big_table_id";
+CREATE TABLE t (a int);
+INSERT INTO t SET a= 0;
+ALTER TABLE t comment '';
+INSERT INTO t SET a= 1;
+ALTER TABLE t comment '';
+INSERT INTO t SET a= 2;
+ALTER TABLE t comment '';
+INSERT INTO t SET a= 3;
+show binlog events in <file> from <pos>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
+master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 0
+master-bin.000002 # Table_map 1 # table_id: 4294967294 (test.t)
+master-bin.000002 # Write_rows_v1 1 # table_id: 4294967294 flags: STMT_END_F
+master-bin.000002 # Query 1 # COMMIT
+master-bin.000002 # Gtid 1 # GTID #-#-#
+master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
+master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
+master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 1
+master-bin.000002 # Table_map 1 # table_id: 4294967298 (test.t)
+master-bin.000002 # Write_rows_v1 1 # table_id: 4294967298 flags: STMT_END_F
+master-bin.000002 # Query 1 # COMMIT
+master-bin.000002 # Gtid 1 # GTID #-#-#
+master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
+master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
+master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 2
+master-bin.000002 # Table_map 1 # table_id: 4294967299 (test.t)
+master-bin.000002 # Write_rows_v1 1 # table_id: 4294967299 flags: STMT_END_F
+master-bin.000002 # Query 1 # COMMIT
+master-bin.000002 # Gtid 1 # GTID #-#-#
+master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment ''
+master-bin.000002 # Gtid 1 # BEGIN GTID #-#-#
+master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 3
+master-bin.000002 # Table_map 1 # table_id: 4294967300 (test.t)
+master-bin.000002 # Write_rows_v1 1 # table_id: 4294967300 flags: STMT_END_F
+master-bin.000002 # Query 1 # COMMIT
+connection slave;
+connection master;
+DROP TABLE t;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_big_table_id.test b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
new file mode 100644
index 00000000000..0c6f9d5e862
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
@@ -0,0 +1,57 @@
+##################################################################
+# rpl_row_big_table_id
+#
+# MDEV-17803 Row-based event is not applied when
+# table map id is greater 32 bit int
+#
+# Verify row-based events applying when table map id value is about and greater
+# than 1 << 32.
+##################################################################
+--source include/word_size.inc
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--connection master
+# To reset last table id
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+SET @@debug_dbug="d,simulate_big_table_id";
+CREATE TABLE t (a int);
+
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $binlog_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+INSERT INTO t SET a= 0;
+ALTER TABLE t comment '';
+INSERT INTO t SET a= 1;
+ALTER TABLE t comment '';
+INSERT INTO t SET a= 2;
+ALTER TABLE t comment '';
+INSERT INTO t SET a= 3;
+
+# display simulated big table_id
+--let $_in_from=in '$binlog_file' from $binlog_pos
+--replace_result "$_in_from" "in <file> from <pos>"
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/
+--eval show binlog events in '$binlog_file' from $binlog_pos
+
+
+--sync_slave_with_master
+
+if (`SELECT sum(a) != 6 FROM t`)
+{
+ --echo *** unexpected result; check slave applier ***
+ --die
+}
+
+
+# Cleanup
+
+--connection master
+DROP TABLE t;
+
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index cb371b33bfd..388fe7b8f4f 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -139,9 +139,6 @@ wsrep_local_state_comment #
SHOW STATUS LIKE 'x';
Variable_name Value
SET GLOBAL wsrep_provider=none;
-#
-# MDEV#6079: xtrabackup SST failing with maria-10.0-galera
-#
SHOW STATUS LIKE 'wsrep_local_state_uuid';
Variable_name Value
diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
index f74b26167b2..c13a8c5f281 100644
--- a/mysql-test/suite/wsrep/t/variables.test
+++ b/mysql-test/suite/wsrep/t/variables.test
@@ -49,15 +49,11 @@ SHOW STATUS LIKE 'x';
# Reset it back.
SET GLOBAL wsrep_provider=none;
---echo #
---echo # MDEV#6079: xtrabackup SST failing with maria-10.0-galera
---echo #
-
--disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--enable_query_log
-# The following 2 variables are used in innobackupex during xtrabackup-based
+# The following 2 variables are used by mariabackup
# SST.
--echo
--replace_column 2 #
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 321826b1975..3e82d379a6d 100755
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -44,13 +44,15 @@ case "$1" in
addr_no_bracket=${WSREP_SST_OPT_ADDR#\[}
readonly WSREP_SST_OPT_HOST_UNESCAPED=${addr_no_bracket%%\]*}
readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]"
+ readonly WSREP_SST_OPT_HOST_ESCAPED="\\[${WSREP_SST_OPT_HOST_UNESCAPED}\\]"
;;
*)
readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST
+ readonly WSREP_SST_OPT_HOST_ESCAPED=$WSREP_SST_OPT_HOST
;;
esac
- remain=${WSREP_SST_OPT_ADDR#"${WSREP_SST_OPT_HOST}"}
+ remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST_ESCAPED}}
remain=${remain#:}
readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*}
remain=${remain#*/}
@@ -274,7 +276,7 @@ wsrep_check_programs()
}
#
-# user can specify xtrabackup specific settings that will be used during sst
+# user can specify mariabackup specific settings that will be used during sst
# process like encryption, etc.....
# parse such configuration option. (group for xb settings is [sst] in my.cnf
#
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 4b778ea9d38..2253bb8763d 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -91,6 +91,9 @@ DATA="${WSREP_SST_OPT_DATA}"
INFO_FILE="xtrabackup_galera_info"
IST_FILE="xtrabackup_ist"
MAGIC_FILE="${DATA}/${INFO_FILE}"
+INNOAPPLYLOG="${DATA}/mariabackup.prepare.log"
+INNOMOVELOG="${DATA}/mariabackup.move.log"
+INNOBACKUPLOG="${DATA}/mariabackup.backup.log"
# Setting the path for ss and ip
export PATH="/usr/sbin:/sbin:$PATH"
@@ -352,6 +355,8 @@ read_cnf()
ssyslog=$(parse_cnf sst sst-syslog 0)
ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}")
ssystag+="-"
+ sstlogarchive=$(parse_cnf sst sst-log-archive 1)
+ sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir "/tmp/sst_log_archive")
if [[ $speciald -eq 0 ]];then
wsrep_log_error "sst-special-dirs equal to 0 is not supported, falling back to 1"
@@ -511,12 +516,24 @@ kill_xtrabackup()
setup_ports()
{
if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then
- SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }')
- REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }')
- lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }')
- sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }')
+ if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then
+ remain=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\][:/]' '{ print $2 }')
+ REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\]:' '{ print $1 }')"]"
+ SST_PORT=$(echo $remain | awk -F '[:/]' '{ print $1 }')
+ lsn=$(echo $remain | awk -F '[:/]' '{ print $3 }')
+ sst_ver=$(echo $remain | awk -F '[:/]' '{ print $4 }')
+ else
+ SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }')
+ REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }')
+ lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }')
+ sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }')
+ fi
else
- SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }')
+ if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then
+ SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $2 }')
+ else
+ SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }')
+ fi
fi
}
@@ -732,10 +749,71 @@ if [[ $ssyslog -eq 1 ]];then
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
fi
-else
- INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log"
+else
+
+if [[ "$sstlogarchive" -eq 1 ]]
+then
+ ARCHIVETIMESTAMP=$(date "+%Y.%m.%d-%H.%M.%S")
+ newfile=""
+
+ if [[ ! -z "$sstlogarchivedir" ]]
+ then
+ if [[ ! -d "$sstlogarchivedir" ]]
+ then
+ mkdir -p "$sstlogarchivedir"
+ fi
+ fi
+
+ if [ -e "${INNOAPPLYLOG}" ]
+ then
+ if [[ ! -z "$sstlogarchivedir" ]]
+ then
+ newfile=$sstlogarchivedir/$(basename "${INNOAPPLYLOG}").${ARCHIVETIMESTAMP}
+ else
+ newfile=${INNOAPPLYLOG}.${ARCHIVETIMESTAMP}
+ fi
+
+ wsrep_log_info "Moving ${INNOAPPLYLOG} to ${newfile}"
+ mv "${INNOAPPLYLOG}" "${newfile}"
+ gzip "${newfile}"
+ fi
+
+ if [ -e "${INNOMOVELOG}" ]
+ then
+ if [[ ! -z "$sstlogarchivedir" ]]
+ then
+ newfile=$sstlogarchivedir/$(basename "${INNOMOVELOG}").${ARCHIVETIMESTAMP}
+ else
+ newfile=${INNOMOVELOG}.${ARCHIVETIMESTAMP}
+ fi
+
+ wsrep_log_info "Moving ${INNOMOVELOG} to ${newfile}"
+ mv "${INNOMOVELOG}" "${newfile}"
+ gzip "${newfile}"
+ fi
+
+ if [ -e "${INNOBACKUPLOG}" ]
+ then
+ if [[ ! -z "$sstlogarchivedir" ]]
+ then
+ newfile=$sstlogarchivedir/$(basename "${INNOBACKUPLOG}").${ARCHIVETIMESTAMP}
+ else
+ newfile=${INNOBACKUPLOG}.${ARCHIVETIMESTAMP}
+ fi
+
+ wsrep_log_info "Moving ${INNOBACKUPLOG} to ${newfile}"
+ mv "${INNOBACKUPLOG}" "${newfile}"
+ gzip "${newfile}"
+ fi
+
+fi
+
INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log"
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log"
+
+ INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &> ${INNOAPPLYLOG}"
+ INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &> ${INNOMOVELOG}"
+ INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> ${INNOBACKUPLOG}"
fi
get_stream
@@ -832,7 +910,7 @@ then
if [ ${RC[0]} -ne 0 ]; then
wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \
- "Check ${DATA}/innobackup.backup.log"
+ "Check syslog or ${INNOBACKUPLOG} for details"
exit 22
elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then
wsrep_log_error "$tcmd finished with error: ${RC[1]}"
@@ -897,7 +975,11 @@ then
if [ -z "${SST_PORT}" ]
then
SST_PORT=4444
- ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}"
+ if [[ ${ADDR:0:1} == '[' ]];then
+ ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $1 }')]:${SST_PORT}"
+ else
+ ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}"
+ fi
fi
wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} &
@@ -1057,13 +1139,12 @@ then
if [ $? -ne 0 ];
then
- wsrep_log_error "${INNOBACKUPEX_BIN} apply finished with errors. Check ${DATA}/innobackup.prepare.log"
+ wsrep_log_error "${INNOBACKUPEX_BIN} apply finished with errors. Check syslog or ${INNOAPPLYLOG} for details"
exit 22
fi
MAGIC_FILE="${TDATA}/${INFO_FILE}"
set +e
- rm $TDATA/innobackup.prepare.log $TDATA/innobackup.move.log
set -e
wsrep_log_info "Moving the backup to ${TDATA}"
timeit "Xtrabackup move stage" "$INNOMOVE"
@@ -1073,7 +1154,7 @@ then
DATA=${TDATA}
else
wsrep_log_error "Move failed, keeping ${DATA} for further diagnosis"
- wsrep_log_error "Check ${DATA}/innobackup.move.log for details"
+ wsrep_log_error "Check syslog or ${INNOMOVELOG} for details"
exit 22
fi
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 12fb9d3ba38..1fecb6f09d9 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -ue
+#!/bin/bash -ue
# Copyright (C) 2010-2014 Codership Oy
#
@@ -88,7 +88,7 @@ check_pid_and_port()
local is_listening_all="$(echo $port_info | \
grep "*:$rsync_port" 2>/dev/null)"
local is_listening_addr="$(echo $port_info | \
- grep "$rsync_addr:$rsync_port" 2>/dev/null)"
+ grep -F "$rsync_addr:$rsync_port" 2>/dev/null)"
if [ ! -z "$is_listening_all" -o ! -z "$is_listening_addr" ]; then
if [ -z "$is_rsync" ]; then
@@ -119,7 +119,7 @@ is_local_ip()
address="$address "
fi
- $get_addr_bin | grep "$address" > /dev/null
+ $get_addr_bin | grep -F "$address" > /dev/null
}
STUNNEL_CONF="$WSREP_SST_OPT_DATA/stunnel.conf"
@@ -399,12 +399,17 @@ then
rm -rf "$RSYNC_PID"
ADDR=$WSREP_SST_OPT_ADDR
- RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }')
- RSYNC_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }')
+ if [[ ${ADDR:0:1} == '[' ]]; then
+ RSYNC_PORT=$(echo $ADDR | awk -F '\\]:' '{ print $2 }')
+ RSYNC_ADDR=$(echo $ADDR | awk -F '\\]:' '{ print $1 }')"]"
+ else
+ RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }')
+ RSYNC_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }')
+ fi
if [ -z "$RSYNC_PORT" ]
then
RSYNC_PORT=4444
- ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT"
+ ADDR="$RSYNC_ADDR:$RSYNC_PORT"
fi
trap "exit 32" HUP PIPE
diff --git a/sql/log_event.cc b/sql/log_event.cc
index ed2b25929e4..5fa2a7ac8d0 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
- Copyright (c) 2009, 2018, MariaDB
+ Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12659,7 +12659,7 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi)
table_list->updating= 1;
table_list->required_type= TABLE_TYPE_NORMAL;
- DBUG_PRINT("debug", ("table: %s is mapped to %u",
+ DBUG_PRINT("debug", ("table: %s is mapped to %lu",
table_list->table_name.str,
table_list->table_id));
table_list->master_had_triggers= ((m_flags & TM_BIT_HAS_TRIGGERS_F) ? 1 : 0);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 216b5d1c622..a338805795d 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5498,7 +5498,8 @@ static int init_server_components()
initialized. This initialization was not possible before, as plugins
(and thus some global system variables) are initialized after wsrep
startup threads are created.
- Note: This only needs to be done for rsync, xtrabackup based SST methods.
+ Note: This only needs to be done for rsync and mariabackup based SST
+ methods.
*/
if (wsrep_before_SE())
wsrep_plugins_post_init();
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 05d765e399a..eca51b54dab 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1561,6 +1561,7 @@ failure:
head->column_bitmaps_set(save_read_set, save_write_set);
delete file;
file= save_file;
+ free_file= false;
DBUG_RETURN(1);
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 11cfce172c5..1ac93de4800 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -6778,6 +6778,12 @@ static bool fill_alter_inplace_info(THD *thd,
KEY *new_key;
KEY *new_key_end=
ha_alter_info->key_info_buffer + ha_alter_info->key_count;
+ /*
+ Primary key index for the new table
+ */
+ const KEY* const new_pk= (ha_alter_info->key_count > 0 &&
+ is_candidate_key(ha_alter_info->key_info_buffer)) ?
+ ha_alter_info->key_info_buffer : NULL;
DBUG_PRINT("info", ("index count old: %d new: %d",
table->s->keys, ha_alter_info->key_count));
@@ -6854,6 +6860,16 @@ static bool fill_alter_inplace_info(THD *thd,
goto index_changed;
}
+ /*
+ Rebuild the index if following condition get satisfied:
+
+ (i) Old table doesn't have primary key, new table has it and vice-versa
+ (ii) Primary key changed to another existing index
+ */
+ if ((new_key == new_pk) !=
+ ((uint) (table_key - table->key_info) == table->s->primary_key))
+ goto index_changed;
+
/* Check that key comment is not changed. */
if (table_key->comment.length != new_key->comment.length ||
(table_key->comment.length &&
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index df681e31d19..4773693c380 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -5377,8 +5377,7 @@ static Sys_var_charptr sys_wsrep_sst_method(
"wsrep_sst_method", "State snapshot transfer method",
GLOBAL_VAR(wsrep_sst_method),CMD_LINE(REQUIRED_ARG),
IN_SYSTEM_CHARSET, DEFAULT(WSREP_SST_DEFAULT), NO_MUTEX_GUARD, NOT_IN_BINLOG,
- ON_CHECK(wsrep_sst_method_check),
- ON_UPDATE(wsrep_sst_method_update));
+ ON_CHECK(wsrep_sst_method_check));
static Sys_var_charptr Sys_wsrep_sst_receive_address(
"wsrep_sst_receive_address", "Address where node is waiting for "
diff --git a/sql/table.cc b/sql/table.cc
index 01f96b5f93b..375f7a3f65f 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -343,6 +343,9 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data,
&share->LOCK_ha_data, MY_MUTEX_INIT_FAST);
+ DBUG_EXECUTE_IF("simulate_big_table_id",
+ if (last_table_id < UINT_MAX32)
+ last_table_id= UINT_MAX32 - 1;);
/*
There is one reserved number that cannot be used. Remember to
change this when 6-byte global table id's are introduced.
@@ -351,7 +354,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
{
share->table_map_id=
last_table_id.fetch_add(1, std::memory_order_relaxed);
- } while (unlikely(share->table_map_id == ~0UL));
+ } while (unlikely(share->table_map_id == ~0UL ||
+ share->table_map_id == 0));
}
DBUG_RETURN(share);
}
diff --git a/sql/table.h b/sql/table.h
index 1720a212a1f..822a1037ea6 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1,7 +1,7 @@
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
- Copyright (c) 2009, 2018, MariaDB
+ Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2070,7 +2070,7 @@ struct TABLE_LIST
/* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
List<Index_hint> *index_hints;
TABLE *table; /* opened table */
- uint table_id; /* table id (from binlog) for opened table */
+ ulong table_id; /* table id (from binlog) for opened table */
/*
select_result for derived table to pass it from table creation to table
filling procedure
diff --git a/sql/unireg.h b/sql/unireg.h
index 6f224ab4894..a24c1b516c5 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -193,7 +193,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const LEX_CSTRING *table,
#define FRM_HEADER_SIZE 64
#define FRM_FORMINFO_SIZE 288
-#define FRM_MAX_SIZE (512*1024)
+#define FRM_MAX_SIZE (1024*1024)
static inline bool is_binary_frm_header(uchar *head)
{
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 0fdc7f0b911..e7f7db206a9 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -776,7 +776,7 @@ void wsrep_init_startup (bool sst_first)
Pre-initialize global_system_variables.table_plugin with a dummy engine
(placeholder) required during the initialization of wsrep threads (THDs).
(see: plugin_thdvar_init())
- Note: This only needs to be done for rsync & xtrabackup based SST methods.
+ Note: This only needs to be done for rsync & mariabackup based SST methods.
In case of mysqldump SST method, the wsrep threads are created after the
server plugins & global system variables are initialized.
*/
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index 4e3a7072629..afbcd4d6c52 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -60,12 +60,7 @@ bool wsrep_sst_method_check (sys_var *self, THD* thd, set_var* var)
return 0;
}
-bool wsrep_sst_method_update (sys_var *self, THD* thd, enum_var_type type)
-{
- return 0;
-}
-
-static const char* data_home_dir= NULL;
+static const char* data_home_dir;
void wsrep_set_data_home_dir(const char *data_dir)
{
diff --git a/sql/wsrep_utils.h b/sql/wsrep_utils.h
index 147da8e7c52..488b455938b 100644
--- a/sql/wsrep_utils.h
+++ b/sql/wsrep_utils.h
@@ -129,7 +129,8 @@ private:
/* Hostname with port (host:port) */
start= addr_in;
end= colon;
- parse_port(colon + 1);
+ if (parse_port(colon + 1))
+ return; /* Error: invalid port */
break;
default:
/* IPv6 address */
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 04671124e45..4ea5a5b30e9 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2018, MariaDB Corporation.
+Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -6973,32 +6973,16 @@ UNIV_INTERN
ulint
dict_sys_get_size()
{
- ulint size = 0;
-
- ut_ad(dict_sys);
-
- mutex_enter(&dict_sys->mutex);
-
- for(ulint i = 0; i < hash_get_n_cells(dict_sys->table_hash); i++) {
- dict_table_t* table;
-
- for (table = static_cast<dict_table_t*>(HASH_GET_FIRST(dict_sys->table_hash,i));
- table != NULL;
- table = static_cast<dict_table_t*>(HASH_GET_NEXT(name_hash, table))) {
- dict_index_t* index;
- size += mem_heap_get_size(table->heap) + strlen(table->name.m_name) +1;
-
- for(index = dict_table_get_first_index(table);
- index != NULL;
- index = dict_table_get_next_index(index)) {
- size += mem_heap_get_size(index->heap);
- }
- }
- }
-
- mutex_exit(&dict_sys->mutex);
-
- return (size);
+ /* No mutex; this is a very crude approximation anyway */
+ ulint size = UT_LIST_GET_LEN(dict_sys->table_LRU)
+ + UT_LIST_GET_LEN(dict_sys->table_non_LRU);
+ size *= sizeof(dict_table_t)
+ + sizeof(dict_index_t) * 2
+ + (sizeof(dict_col_t) + sizeof(dict_field_t)) * 10
+ + sizeof(dict_field_t) * 5 /* total number of key fields */
+ + 200; /* arbitrary, covering names and overhead */
+
+ return size;
}
/** Look for any dictionary objects that are found in the given tablespace.
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index ffd82ca9415..4ca79ca96c4 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2018, MariaDB Corporation.
+Copyright (c) 2014, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -764,10 +764,9 @@ fil_try_to_close_file_in_LRU(
}
/** Flush any writes cached by the file system.
-@param[in,out] space tablespace */
-static
-void
-fil_flush_low(fil_space_t* space)
+@param[in,out] space tablespace
+@param[in] metadata whether to update file system metadata */
+static void fil_flush_low(fil_space_t* space, bool metadata = false)
{
ut_ad(mutex_own(&fil_system.mutex));
ut_ad(space);
@@ -791,7 +790,7 @@ fil_flush_low(fil_space_t* space)
}
#endif /* UNIV_DEBUG */
- return;
+ if (!metadata) return;
}
/* Prevent dropping of the space while we are flushing */
@@ -968,6 +967,7 @@ fil_space_extend_must_retry(
os_has_said_disk_full = *success;
if (*success) {
+ os_file_flush(node->handle);
last_page_no = size;
} else {
/* Let us measure the size of the file
@@ -999,14 +999,14 @@ fil_space_extend_must_retry(
switch (space->id) {
case TRX_SYS_SPACE:
srv_sys_space.set_last_file_size(pages_in_MiB);
- fil_flush_low(space);
+ fil_flush_low(space, true);
return(false);
default:
ut_ad(space->purpose == FIL_TYPE_TABLESPACE
|| space->purpose == FIL_TYPE_IMPORT);
if (space->purpose == FIL_TYPE_TABLESPACE
&& !space->is_being_truncated) {
- fil_flush_low(space);
+ fil_flush_low(space, true);
}
return(false);
case SRV_TMP_SPACE_ID:
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 186c3ee3154..683a6417747 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -3717,15 +3717,6 @@ static int innodb_init_params()
ib::info() << "For Galera, using innodb_lock_schedule_algorithm=fcfs";
innodb_lock_schedule_algorithm = INNODB_LOCK_SCHEDULE_ALGORITHM_FCFS;
}
-
- /* Print deprecation info if xtrabackup is used for SST method */
- if (global_system_variables.wsrep_on
- && wsrep_sst_method
- && (!strcmp(wsrep_sst_method, "xtrabackup")
- || !strcmp(wsrep_sst_method, "xtrabackup-v2"))) {
- ib::info() << "Galera SST method xtrabackup is deprecated and the "
- " support for it may be removed in future releases.";
- }
#endif /* WITH_WSREP */
#ifndef HAVE_LZ4
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index abed80130ad..5f6cd3d13c5 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -729,8 +729,7 @@ struct dict_v_col_t{
ulint v_pos;
/** Virtual index list, and column position in the index,
- the allocated memory is not from table->heap, nor it is
- tracked by dict_sys->size */
+ the allocated memory is not from table->heap */
dict_v_idx_list* v_indexes;
};
@@ -1784,15 +1783,7 @@ public:
/** Hash chain node. */
hash_node_t name_hash;
- /** Memory heap. If you allocate from this heap after the table has
- been created then be sure to account the allocation into
- dict_sys->size. When closing the table we do something like
- dict_sys->size -= mem_heap_get_size(table->heap) and if that is going
- to become negative then we would assert. Something like this should do:
- old_size = mem_heap_get_size()
- mem_heap_alloc()
- new_size = mem_heap_get_size()
- dict_sys->size += new_size - old_size. */
+ /** Memory heap */
mem_heap_t* heap;
/** NULL or the directory path specified by DATA DIRECTORY. */
diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h
index f21b3416ef6..d411e0efdc2 100644
--- a/storage/innobase/include/row0upd.h
+++ b/storage/innobase/include/row0upd.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
@@ -194,6 +194,7 @@ the equal ordering fields. NOTE: we compare the fields as binary strings!
@param[in] heap memory heap from which allocated
@param[in,out] mysql_table NULL, or mysql table object when
user thread invokes dml
+@param[out] error error number in case of failure
@return own: update vector of differing fields, excluding roll ptr and
trx id */
upd_t*
@@ -205,8 +206,9 @@ row_upd_build_difference_binary(
bool no_sys,
trx_t* trx,
mem_heap_t* heap,
- TABLE* mysql_table)
- MY_ATTRIBUTE((nonnull(1,2,3,7), warn_unused_result));
+ TABLE* mysql_table,
+ dberr_t* error)
+ MY_ATTRIBUTE((nonnull(1,2,3,7,9), warn_unused_result));
/** Apply an update vector to an index entry.
@param[in,out] entry index entry to be updated; the clustered index record
must be covered by a lock or a page latch to prevent
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index a49709e3283..503b6feab30 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -39,10 +39,6 @@ Created 1/20/1994 Heikki Tuuri
#define _IB_TO_STR(s) #s
#define IB_TO_STR(s) _IB_TO_STR(s)
-#define INNODB_VERSION_MAJOR 5
-#define INNODB_VERSION_MINOR 7
-#define INNODB_VERSION_BUGFIX 24
-
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
calculated in make_version_string() in sql/sql_show.cc like this:
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 3c8a3a3e578..f7a436ed68e 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2018, MariaDB Corporation.
+Copyright (c) 2013, 2019, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted
by Percona Inc.. Those modifications are
@@ -1755,6 +1755,8 @@ LinuxAIOHandler::resubmit(Slot* slot)
slot->n_bytes = 0;
slot->io_already_done = false;
+ compile_time_assert(sizeof(off_t) >= sizeof(os_offset_t));
+
struct iocb* iocb = &slot->control;
if (slot->type.is_read()) {
@@ -1764,7 +1766,7 @@ LinuxAIOHandler::resubmit(Slot* slot)
slot->file,
slot->ptr,
slot->len,
- static_cast<off_t>(slot->offset));
+ slot->offset);
} else {
ut_a(slot->type.is_write());
@@ -1774,7 +1776,7 @@ LinuxAIOHandler::resubmit(Slot* slot)
slot->file,
slot->ptr,
slot->len,
- static_cast<off_t>(slot->offset));
+ slot->offset);
}
iocb->data = slot;
@@ -6253,7 +6255,7 @@ AIO::reserve_slot(
#ifdef _WIN32
slot->len = static_cast<DWORD>(len);
#else
- slot->len = static_cast<ulint>(len);
+ slot->len = len;
#endif /* _WIN32 */
slot->type = type;
slot->buf = static_cast<byte*>(buf);
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index ed72f6d482b..682989ac701 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -331,7 +331,7 @@ row_ins_clust_index_entry_by_modify(
{
const rec_t* rec;
upd_t* update;
- dberr_t err;
+ dberr_t err = DB_SUCCESS;
btr_cur_t* cursor = btr_pcur_get_btr_cur(pcur);
TABLE* mysql_table = NULL;
ut_ad(dict_index_is_clust(cursor->index));
@@ -354,7 +354,11 @@ row_ins_clust_index_entry_by_modify(
update = row_upd_build_difference_binary(
cursor->index, entry, rec, NULL, true,
- thr_get_trx(thr), heap, mysql_table);
+ thr_get_trx(thr), heap, mysql_table, &err);
+ if (err != DB_SUCCESS) {
+ return(err);
+ }
+
if (mode != BTR_MODIFY_TREE) {
ut_ad((mode & ulint(~BTR_ALREADY_S_LATCHED))
== BTR_MODIFY_LEAF);
@@ -965,11 +969,11 @@ row_ins_foreign_fill_virtual(
if (innobase_allocate_row_for_vcol(thd, index, &v_heap,
&mysql_table,
- &record, &vcol_storage))
- {
+ &record, &vcol_storage)) {
+ if (v_heap) mem_heap_free(v_heap);
*err = DB_OUT_OF_MEMORY;
- goto func_exit;
- }
+ goto func_exit;
+ }
for (ulint i = 0; i < n_v_fld; i++) {
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 59b53a89cdd..09df80f789d 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -2234,7 +2234,10 @@ func_exit_committed:
row, NULL, index, heap, ROW_BUILD_NORMAL);
upd_t* update = row_upd_build_difference_binary(
index, entry, btr_pcur_get_rec(&pcur), cur_offsets,
- false, NULL, heap, dup->table);
+ false, NULL, heap, dup->table, &error);
+ if (error != DB_SUCCESS) {
+ goto func_exit;
+ }
if (!update->n_fields) {
/* Nothing to do. */
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index a60210c77c8..25cc68ab847 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -972,8 +972,9 @@ the equal ordering fields. NOTE: we compare the fields as binary strings!
@param[in] heap memory heap from which allocated
@param[in] mysql_table NULL, or mysql table object when
user thread invokes dml
+@param[out] error error number in case of failure
@return own: update vector of differing fields, excluding roll ptr and
-trx id */
+trx id,if error is not equal to DB_SUCCESS, return NULL */
upd_t*
row_upd_build_difference_binary(
dict_index_t* index,
@@ -983,7 +984,8 @@ row_upd_build_difference_binary(
bool no_sys,
trx_t* trx,
mem_heap_t* heap,
- TABLE* mysql_table)
+ TABLE* mysql_table,
+ dberr_t* error)
{
upd_field_t* upd_field;
dfield_t* dfield;
@@ -1082,6 +1084,11 @@ row_upd_build_difference_binary(
update->old_vrow, col, index,
&v_heap, heap, NULL, thd, mysql_table, record,
NULL, NULL, NULL);
+ if (vfield == NULL) {
+ if (v_heap) mem_heap_free(v_heap);
+ *error = DB_COMPUTE_VALUE_FAILED;
+ return(NULL);
+ }
if (!dfield_data_is_binary_equal(
dfield, vfield->len,
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 3b5461aae25..34638dfda25 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2018, MariaDB Corporation.
+Copyright (c) 2013, 2019, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index e15afcf9cd7..108e9182f00 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1626,6 +1626,10 @@ dberr_t srv_start(bool create_new_db)
break;
}
+ if (stat_info.type != OS_FILE_TYPE_FILE) {
+ break;
+ }
+
if (!srv_file_check_mode(logfilename)) {
return(srv_init_abort(DB_ERROR));
}
diff --git a/support-files/policy/apparmor/usr.sbin.mysqld b/support-files/policy/apparmor/usr.sbin.mysqld
index 05ec77414d2..6555c614889 100644
--- a/support-files/policy/apparmor/usr.sbin.mysqld
+++ b/support-files/policy/apparmor/usr.sbin.mysqld
@@ -101,13 +101,12 @@
/usr/bin/cut rix,
/usr/bin/dirname rix,
/usr/bin/gawk rix,
- /usr/bin/innobackupex rix,
/usr/bin/mysql rix,
/usr/bin/perl rix,
/usr/bin/seq rix,
/usr/bin/wsrep_sst* rix,
/usr/bin/wsrep_sst_common r,
- /usr/bin/xtrabackup* rix,
+ /usr/bin/mariabackup* rix,
/var/lib/mysql/ r,
/var/lib/mysql/** rw,
/var/lib/mysql/*.log w,
diff --git a/support-files/policy/selinux/mariadb-server.fc b/support-files/policy/selinux/mariadb-server.fc
index 409f72923aa..e3f2b5015c7 100644
--- a/support-files/policy/selinux/mariadb-server.fc
+++ b/support-files/policy/selinux/mariadb-server.fc
@@ -6,5 +6,5 @@
/var/lib/mysql/.*\.err -- gen_context(system_u:object_r:mysqld_log_t,s0)
/var/lib/mysql/.*\.pid -- gen_context(system_u:object_r:mysqld_var_run_t,s0)
/var/lib/mysql/.*\.cnf -- gen_context(system_u:object_r:mysqld_etc_t,s0)
-/usr/bin/xtrabackup.* -- gen_context(system_u:object_r:mysqld_exec_t,s0)
+/usr/bin/mariabackup.* -- gen_context(system_u:object_r:mysqld_exec_t,s0)
/usr/bin/wsrep.* -- gen_context(system_u:object_r:mysqld_safe_exec_t,s0)
diff --git a/support-files/policy/selinux/mariadb-server.te b/support-files/policy/selinux/mariadb-server.te
index 45ef40f4153..71924012283 100644
--- a/support-files/policy/selinux/mariadb-server.te
+++ b/support-files/policy/selinux/mariadb-server.te
@@ -78,7 +78,7 @@ allow mysqld_t user_tmp_t:file create;
allow mysqld_t bin_t:lnk_file read;
allow mysqld_t tmp_t:file { append create read write open getattr unlink setattr };
-# Allows too much leeway - the xtrabackup/wsrep rules in fc should fix it, but
+# Allows too much leeway - the mariabackup/wsrep rules in fc should fix it, but
# keep for the moment.
allow mysqld_t shell_exec_t:file { execute_no_trans getattr read execute open };
allow mysqld_t bin_t:file { getattr read execute open execute_no_trans ioctl };
@@ -93,7 +93,7 @@ allow mysqld_t tram_port_t:tcp_socket name_bind;
# This rule allows port udp/4567 (see README)
allow mysqld_t mysqld_port_t:udp_socket name_bind;
-# Rules related to XtraBackup
+# Rules related to mariabackup
allow mysqld_t self:netlink_tcpdiag_socket { create nlmsg_read };
allow mysqld_t sysctl_net_t:file { read getattr open };