summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-10-06 09:22:39 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-10-06 09:22:39 +0300
commit6dc157f8a6a6f12fcb6877c65c23a2e7692e38fe (patch)
treea143f8592261301d3e0a42dcc33bddc3634227d9
parent286acaa796cd3c7e7a8d20eba20673ae1ab70b61 (diff)
parent8d6421aa48de5f1581e0706cc65c3515954bcead (diff)
downloadmariadb-git-6dc157f8a6a6f12fcb6877c65c23a2e7692e38fe.tar.gz
Merge 10.5 into 10.6
-rw-r--r--client/mysqlimport.c6
-rw-r--r--config.h.cmake1
-rw-r--r--configure.cmake1
-rw-r--r--mysql-test/include/ipv6.inc1
-rw-r--r--mysql-test/include/long_test.inc2
-rw-r--r--mysql-test/include/master-slave.inc2
-rw-r--r--mysql-test/main/alter_table.test1
-rw-r--r--mysql-test/main/compress.test2
-rw-r--r--mysql-test/main/ctype_big5.test1
-rw-r--r--mysql-test/main/ctype_gb2312.test1
-rw-r--r--mysql-test/main/ctype_gbk.test1
-rw-r--r--mysql-test/main/ctype_sjis.test1
-rw-r--r--mysql-test/main/ctype_utf8.test1
-rw-r--r--mysql-test/main/gis-precise.test4
-rw-r--r--mysql-test/main/group_min_max.test1
-rw-r--r--mysql-test/main/index_merge_innodb.test1
-rw-r--r--mysql-test/main/index_merge_myisam.test1
-rw-r--r--mysql-test/main/information_schema_all_engines.test1
-rw-r--r--mysql-test/main/innodb_ext_key.test1
-rw-r--r--mysql-test/main/join_cache.test6
-rw-r--r--mysql-test/main/log_slow.test2
-rw-r--r--mysql-test/main/mysql_client_test_comp.test1
-rw-r--r--mysql-test/main/mysql_upgrade.test1
-rw-r--r--mysql-test/main/mysqldump.test1
-rw-r--r--mysql-test/main/order_by.test1
-rw-r--r--mysql-test/main/plugin_auth.test1
-rw-r--r--mysql-test/main/pool_of_threads.test3
-rw-r--r--mysql-test/main/query_cache.test1
-rw-r--r--mysql-test/main/query_cache_debug.test1
-rw-r--r--mysql-test/main/range.test1
-rw-r--r--mysql-test/main/range_innodb.test1
-rw-r--r--mysql-test/main/range_vs_index_merge.test1
-rw-r--r--mysql-test/main/rowid_filter_innodb.test1
-rw-r--r--mysql-test/main/rowid_filter_innodb_debug.test1
-rw-r--r--mysql-test/main/select.test2
-rw-r--r--mysql-test/main/selectivity.test1
-rw-r--r--mysql-test/main/sp.test1
-rw-r--r--mysql-test/main/ssl-big.test1
-rw-r--r--mysql-test/main/ssl.test1
-rw-r--r--mysql-test/main/stat_tables_disabled.test2
-rw-r--r--mysql-test/main/stat_tables_innodb.test1
-rw-r--r--mysql-test/main/stat_tables_par_innodb.test1
-rw-r--r--mysql-test/main/statistics.test1
-rw-r--r--mysql-test/main/subselect_innodb.test1
-rw-r--r--mysql-test/main/subselect_sj.test1
-rw-r--r--mysql-test/main/subselect_sj_jcl6.test1
-rw-r--r--mysql-test/main/trigger.test3
-rw-r--r--mysql-test/main/update_use_source.test1
-rw-r--r--mysql-test/main/win.test1
-rw-r--r--mysql-test/main/win_big-mdev-11697.test2
-rwxr-xr-xmysql-test/std_data/wsrep_notify.sh126
-rwxr-xr-xmysql-test/std_data/wsrep_notify_ssl.sh195
-rw-r--r--mysql-test/suite/federated/federatedx_create_handlers.test1
-rw-r--r--mysql-test/suite/galera/disabled.def1
-rw-r--r--mysql-test/suite/galera/r/galera_var_notify_ssl_ipv6.result11
-rw-r--r--mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf20
-rw-r--r--mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.test20
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result3
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test3
-rw-r--r--mysql-test/suite/innodb/r/purge_secondary.result15
-rw-r--r--mysql-test/suite/innodb/t/alter_large_dml.test2
-rw-r--r--mysql-test/suite/innodb/t/alter_missing_tablespace.test1
-rw-r--r--mysql-test/suite/innodb/t/autoinc_persist.test1
-rw-r--r--mysql-test/suite/innodb/t/ibuf_not_empty.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-get-fk.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-stats-sample.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-trim.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug30423.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53290.test1
-rw-r--r--mysql-test/suite/innodb/t/log_corruption.test1
-rw-r--r--mysql-test/suite/innodb/t/log_file.test1
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test2
-rw-r--r--mysql-test/suite/innodb/t/missing_tablespaces.test1
-rw-r--r--mysql-test/suite/innodb/t/purge_secondary.test32
-rw-r--r--mysql-test/suite/innodb/t/read_only_recover_committed.test1
-rw-r--r--mysql-test/suite/innodb/t/recovery_shutdown.test1
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test7
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate.test1
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc.test1
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test1
-rw-r--r--mysql-test/suite/mariabackup/log_page_corruption.test1
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_stop_start.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev12179.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_await_ack.test2
-rw-r--r--mysql-test/suite/stress/t/ddl_innodb.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_method_func.test2
-rw-r--r--sql/sql_analyse.cc4
-rw-r--r--storage/innobase/btr/btr0btr.cc4
-rw-r--r--storage/innobase/btr/btr0cur.cc75
-rw-r--r--storage/innobase/btr/btr0pcur.cc9
-rw-r--r--storage/innobase/btr/btr0sea.cc131
-rw-r--r--storage/innobase/dict/dict0dict.cc4
-rw-r--r--storage/innobase/fts/fts0fts.cc4
-rw-r--r--storage/innobase/gis/gis0sea.cc4
-rw-r--r--storage/innobase/include/btr0cur.h68
-rw-r--r--storage/innobase/include/btr0pcur.h49
-rw-r--r--storage/innobase/include/btr0pcur.inl80
-rw-r--r--storage/innobase/include/btr0sea.h11
-rw-r--r--storage/innobase/include/trx0rec.h24
-rw-r--r--storage/innobase/row/row0ins.cc10
-rw-r--r--storage/innobase/row/row0log.cc6
-rw-r--r--storage/innobase/row/row0merge.cc6
-rw-r--r--storage/innobase/row/row0purge.cc137
-rw-r--r--storage/innobase/row/row0sel.cc50
-rw-r--r--storage/innobase/trx/trx0rec.cc177
-rw-r--r--storage/innobase/trx/trx0trx.cc2
-rw-r--r--storage/maria/aria_ftdump.c4
-rw-r--r--storage/myisam/myisam_ftdump.c4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result39
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf3
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29484.test47
-rw-r--r--storage/spider/spd_trx.cc14
-rwxr-xr-x[-rw-r--r--]support-files/wsrep_notify.sh123
117 files changed, 1034 insertions, 596 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 395b64d1119..185cf69b9b6 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2011, 2017, MariaDB
+ Copyright (c) 2011, 2022, 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
@@ -382,11 +382,7 @@ static int write_to_table(char *filename, MYSQL *mysql)
{
if (verbose)
fprintf(stdout, "Deleting the old data from table %s\n", tablename);
-#ifdef HAVE_SNPRINTF
snprintf(sql_statement, FN_REFLEN*16+256, "DELETE FROM %s", tablename);
-#else
- sprintf(sql_statement, "DELETE FROM %s", tablename);
-#endif
if (mysql_query(mysql, sql_statement))
{
db_error_with_table(mysql, tablename);
diff --git a/config.h.cmake b/config.h.cmake
index b58496a8a73..224cbb82b16 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -221,7 +221,6 @@
#cmakedefine HAVE_SIGWAIT 1
#cmakedefine HAVE_SIGWAITINFO 1
#cmakedefine HAVE_SLEEP 1
-#cmakedefine HAVE_SNPRINTF 1
#cmakedefine HAVE_STPCPY 1
#cmakedefine HAVE_STRERROR 1
#cmakedefine HAVE_STRCOLL 1
diff --git a/configure.cmake b/configure.cmake
index 5b49a065b5a..faff9f40115 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -406,7 +406,6 @@ CHECK_FUNCTION_EXISTS (sigwait HAVE_SIGWAIT)
CHECK_FUNCTION_EXISTS (sigwaitinfo HAVE_SIGWAITINFO)
CHECK_FUNCTION_EXISTS (sigset HAVE_SIGSET)
CHECK_FUNCTION_EXISTS (sleep HAVE_SLEEP)
-CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS (stpcpy HAVE_STPCPY)
CHECK_FUNCTION_EXISTS (strcoll HAVE_STRCOLL)
CHECK_FUNCTION_EXISTS (strerror HAVE_STRERROR)
diff --git a/mysql-test/include/ipv6.inc b/mysql-test/include/ipv6.inc
index 3d8fdcfbc3c..05c65d7817a 100644
--- a/mysql-test/include/ipv6.inc
+++ b/mysql-test/include/ipv6.inc
@@ -22,4 +22,3 @@ eval SET PASSWORD FOR testuser1@'$IPv6' = PASSWORD ('9876');
--replace_result ::1 localhost
SELECT USER();
eval DROP USER testuser1@'$IPv6';
-
diff --git a/mysql-test/include/long_test.inc b/mysql-test/include/long_test.inc
index d9a3b338229..765f88b8037 100644
--- a/mysql-test/include/long_test.inc
+++ b/mysql-test/include/long_test.inc
@@ -2,3 +2,5 @@
# We can use this to schedule such test early (to not be left with
# only one or two long tests running, and rests of works idle), or to
# run a quick test skipping long-running test cases.
+
+--source include/no_valgrind_without_big.inc
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc
index 9ed206b2c22..5b603fbfdb3 100644
--- a/mysql-test/include/master-slave.inc
+++ b/mysql-test/include/master-slave.inc
@@ -1,3 +1,5 @@
+--source include/no_valgrind_without_big.inc
+
# ==== Purpose ====
#
# Configure two servers to be replication master and slave.
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index b339da5edb2..5eb6cdb0f9d 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc
#
# Test of alter table
diff --git a/mysql-test/main/compress.test b/mysql-test/main/compress.test
index 8fc21d9c961..daa133ebdc7 100644
--- a/mysql-test/main/compress.test
+++ b/mysql-test/main/compress.test
@@ -1,6 +1,8 @@
# Turn on compression between the client and server
# and run a number of tests
+# Too slow for valgrind
+--source include/no_valgrind_without_big.inc
# Can't test with embedded server
-- source include/not_embedded.inc
-- source include/have_compress.inc
diff --git a/mysql-test/main/ctype_big5.test b/mysql-test/main/ctype_big5.test
index 41991258886..180fa1690fa 100644
--- a/mysql-test/main/ctype_big5.test
+++ b/mysql-test/main/ctype_big5.test
@@ -1,3 +1,4 @@
+-- source include/no_valgrind_without_big.inc
-- source include/have_big5.inc
#
diff --git a/mysql-test/main/ctype_gb2312.test b/mysql-test/main/ctype_gb2312.test
index 07460116ade..96d60445707 100644
--- a/mysql-test/main/ctype_gb2312.test
+++ b/mysql-test/main/ctype_gb2312.test
@@ -1,3 +1,4 @@
+-- source include/no_valgrind_without_big.inc
-- source include/have_gb2312.inc
#
diff --git a/mysql-test/main/ctype_gbk.test b/mysql-test/main/ctype_gbk.test
index d68b78f847c..a2046012685 100644
--- a/mysql-test/main/ctype_gbk.test
+++ b/mysql-test/main/ctype_gbk.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
-- source include/have_gbk.inc
#
diff --git a/mysql-test/main/ctype_sjis.test b/mysql-test/main/ctype_sjis.test
index ecb870242c5..13f919f0c94 100644
--- a/mysql-test/main/ctype_sjis.test
+++ b/mysql-test/main/ctype_sjis.test
@@ -1,3 +1,4 @@
+-- source include/no_valgrind_without_big.inc
-- source include/have_sjis.inc
#
diff --git a/mysql-test/main/ctype_utf8.test b/mysql-test/main/ctype_utf8.test
index 844e812acb3..a70d8aa5617 100644
--- a/mysql-test/main/ctype_utf8.test
+++ b/mysql-test/main/ctype_utf8.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
#
# Tests with the utf8 character set
#
diff --git a/mysql-test/main/gis-precise.test b/mysql-test/main/gis-precise.test
index da72a0c4d8a..f49b3f1a1da 100644
--- a/mysql-test/main/gis-precise.test
+++ b/mysql-test/main/gis-precise.test
@@ -1,5 +1,5 @@
--- source include/have_geometry.inc
-
+--source include/no_valgrind_without_big.inc
+--source include/have_geometry.inc
#
# Spatial objects
diff --git a/mysql-test/main/group_min_max.test b/mysql-test/main/group_min_max.test
index ed65745a509..cf9952e817d 100644
--- a/mysql-test/main/group_min_max.test
+++ b/mysql-test/main/group_min_max.test
@@ -3,6 +3,7 @@
# The queries in this file test query execution via QUICK_GROUP_MIN_MAX_SELECT.
#
+--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc
--source include/have_sequence.inc
--source include/have_innodb.inc
diff --git a/mysql-test/main/index_merge_innodb.test b/mysql-test/main/index_merge_innodb.test
index e8ebb6b2a64..82f3c756da4 100644
--- a/mysql-test/main/index_merge_innodb.test
+++ b/mysql-test/main/index_merge_innodb.test
@@ -11,6 +11,7 @@
#
# Slow test, don't run during staging part
+--source include/long_test.inc
--source include/not_staging.inc
--source include/have_innodb.inc
diff --git a/mysql-test/main/index_merge_myisam.test b/mysql-test/main/index_merge_myisam.test
index 10ddbee36b2..0437f9138cb 100644
--- a/mysql-test/main/index_merge_myisam.test
+++ b/mysql-test/main/index_merge_myisam.test
@@ -9,6 +9,7 @@
# wrapper t/index_merge_innodb.test sources now several
# include/index_merge*.inc files
#
+--source include/no_valgrind_without_big.inc
SET DEFAULT_STORAGE_ENGINE = MyISAM;
# MyISAM supports Merge tables
diff --git a/mysql-test/main/information_schema_all_engines.test b/mysql-test/main/information_schema_all_engines.test
index f8d685d2560..04537051acb 100644
--- a/mysql-test/main/information_schema_all_engines.test
+++ b/mysql-test/main/information_schema_all_engines.test
@@ -2,6 +2,7 @@
# information_schema_db.test whose results depends on which engines are
# available (since these engines inject tables into INFORMATION_SCHEMA).
+--source include/no_valgrind_without_big.inc
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_perfschema.inc
diff --git a/mysql-test/main/innodb_ext_key.test b/mysql-test/main/innodb_ext_key.test
index f1cf6658f0b..ecaf8aa874e 100644
--- a/mysql-test/main/innodb_ext_key.test
+++ b/mysql-test/main/innodb_ext_key.test
@@ -1,4 +1,5 @@
--source include/innodb_prefix_index_cluster_optimization.inc
+--source include/no_valgrind_without_big.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';
diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test
index 4b659345db4..e31937efc1b 100644
--- a/mysql-test/main/join_cache.test
+++ b/mysql-test/main/join_cache.test
@@ -1,9 +1,11 @@
+--source include/no_valgrind_without_big.inc
+--source include/default_optimizer_switch.inc
+--source include/default_charset.inc
+
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11;
DROP DATABASE IF EXISTS world;
--enable_warnings
---source include/default_optimizer_switch.inc
---source include/default_charset.inc
set @org_optimizer_switch=@@optimizer_switch;
set @save_join_cache_level=@@join_cache_level;
diff --git a/mysql-test/main/log_slow.test b/mysql-test/main/log_slow.test
index 64fd8202985..b51777d859e 100644
--- a/mysql-test/main/log_slow.test
+++ b/mysql-test/main/log_slow.test
@@ -1,3 +1,5 @@
+--source include/no_valgrind_without_big.inc
+
#
# Testing of slow log query options
#
diff --git a/mysql-test/main/mysql_client_test_comp.test b/mysql-test/main/mysql_client_test_comp.test
index f8bd80fc48a..36a12b6691e 100644
--- a/mysql-test/main/mysql_client_test_comp.test
+++ b/mysql-test/main/mysql_client_test_comp.test
@@ -3,6 +3,7 @@
# No need to run this with embedded server
--source include/not_embedded.inc
--source include/check_ipv6.inc
+--source include/no_valgrind_without_big.inc
# need to have the dynamic loading turned on for the client plugin tests
--source include/have_plugin_auth.inc
diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test
index 3254b8d2d91..1fe884b16c9 100644
--- a/mysql-test/main/mysql_upgrade.test
+++ b/mysql-test/main/mysql_upgrade.test
@@ -2,6 +2,7 @@
-- source include/have_working_dns.inc
-- source include/have_innodb.inc
-- source include/have_partition.inc
+-- source include/no_valgrind_without_big.inc
set sql_mode="";
diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test
index b7031e535a9..5dd78634b53 100644
--- a/mysql-test/main/mysqldump.test
+++ b/mysql-test/main/mysqldump.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/have_utf8mb4.inc
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");
diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test
index cf1e8cbd0dd..b2f26f5a5e8 100644
--- a/mysql-test/main/order_by.test
+++ b/mysql-test/main/order_by.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
#
# Testing ORDER BY
#
diff --git a/mysql-test/main/plugin_auth.test b/mysql-test/main/plugin_auth.test
index 30e4fa6e0ad..6912462066c 100644
--- a/mysql-test/main/plugin_auth.test
+++ b/mysql-test/main/plugin_auth.test
@@ -2,6 +2,7 @@
--source include/not_embedded.inc
--source include/mysql_upgrade_preparation.inc
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
SET GLOBAL SQL_MODE="";
SET LOCAL SQL_MODE="";
diff --git a/mysql-test/main/pool_of_threads.test b/mysql-test/main/pool_of_threads.test
index 3d581d4605d..e9f083b2f8f 100644
--- a/mysql-test/main/pool_of_threads.test
+++ b/mysql-test/main/pool_of_threads.test
@@ -4,10 +4,11 @@
-- source include/have_pool_of_threads.inc
-- source include/default_optimizer_switch.inc
-SET optimizer_switch='outer_join_with_cache=off';
# Slow test, don't run during staging part
-- source include/not_staging.inc
-- source include/long_test.inc
+
+SET optimizer_switch='outer_join_with_cache=off';
-- source include/common-tests.inc
SET optimizer_switch=default;
diff --git a/mysql-test/main/query_cache.test b/mysql-test/main/query_cache.test
index f8152945396..559d2a8e810 100644
--- a/mysql-test/main/query_cache.test
+++ b/mysql-test/main/query_cache.test
@@ -1,5 +1,6 @@
-- source include/have_query_cache.inc
-- source include/long_test.inc
+-- source include/no_valgrind_without_big.inc
set @save_query_cache_size=@@query_cache_size;
#
diff --git a/mysql-test/main/query_cache_debug.test b/mysql-test/main/query_cache_debug.test
index af82927245b..056396984d9 100644
--- a/mysql-test/main/query_cache_debug.test
+++ b/mysql-test/main/query_cache_debug.test
@@ -2,6 +2,7 @@
--source include/have_query_cache.inc
--source include/have_debug_sync.inc
--source include/long_test.inc
+--source include/no_valgrind_without_big.inc
set global query_cache_type= ON;
set @save_query_cache_size=@@global.query_cache_size;
diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test
index a785726cb22..0de13797da0 100644
--- a/mysql-test/main/range.test
+++ b/mysql-test/main/range.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
#
# Problem with range optimizer
#
diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test
index df0fff403a8..b6dea2fbe06 100644
--- a/mysql-test/main/range_innodb.test
+++ b/mysql-test/main/range_innodb.test
@@ -4,6 +4,7 @@
--source include/have_innodb.inc
--source include/have_debug.inc
+--source include/no_valgrind_without_big.inc
--disable_warnings
drop table if exists t0, t1, t2;
diff --git a/mysql-test/main/range_vs_index_merge.test b/mysql-test/main/range_vs_index_merge.test
index 670762bcb2f..bafd1603457 100644
--- a/mysql-test/main/range_vs_index_merge.test
+++ b/mysql-test/main/range_vs_index_merge.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc
--source include/default_charset.inc
--source include/have_sequence.inc
diff --git a/mysql-test/main/rowid_filter_innodb.test b/mysql-test/main/rowid_filter_innodb.test
index 97b9aa0102c..1112d7b69c6 100644
--- a/mysql-test/main/rowid_filter_innodb.test
+++ b/mysql-test/main/rowid_filter_innodb.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';
diff --git a/mysql-test/main/rowid_filter_innodb_debug.test b/mysql-test/main/rowid_filter_innodb_debug.test
index eb43edd9e9e..31fbd937304 100644
--- a/mysql-test/main/rowid_filter_innodb_debug.test
+++ b/mysql-test/main/rowid_filter_innodb_debug.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
set default_storage_engine=innodb;
--source include/rowid_filter_debug_kill.inc
diff --git a/mysql-test/main/select.test b/mysql-test/main/select.test
index fa1cd2d8f26..b9cfb169537 100644
--- a/mysql-test/main/select.test
+++ b/mysql-test/main/select.test
@@ -2,6 +2,8 @@
# Find string "NOTE NOTE NOTE" in order to find some 'unsure' tests
#
+--source include/no_valgrind_without_big.inc
+
#
# Simple select test
#
diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test
index 1d96dc0bf80..ba0af502720 100644
--- a/mysql-test/main/selectivity.test
+++ b/mysql-test/main/selectivity.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/have_stat_tables.inc
--source include/have_sequence.inc
--source include/default_charset.inc
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index fd076ee9efe..5713f22defa 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/have_partition.inc
--source include/have_sequence.inc
diff --git a/mysql-test/main/ssl-big.test b/mysql-test/main/ssl-big.test
index fa35146e627..46076e03e70 100644
--- a/mysql-test/main/ssl-big.test
+++ b/mysql-test/main/ssl-big.test
@@ -6,6 +6,7 @@
-- source include/have_64bit.inc
# No point in running with valgrind as it takes 1.5 hours
-- source include/not_valgrind.inc
+# This test often times out with MemorySanitizer.
-- source include/not_msan.inc
# Save the initial number of concurrent sessions
diff --git a/mysql-test/main/ssl.test b/mysql-test/main/ssl.test
index 82ada27ffd4..d3830bb7007 100644
--- a/mysql-test/main/ssl.test
+++ b/mysql-test/main/ssl.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
# Turn on ssl between the client and server
# and run a number of tests
diff --git a/mysql-test/main/stat_tables_disabled.test b/mysql-test/main/stat_tables_disabled.test
index e6b965afe34..27b99d0dfdf 100644
--- a/mysql-test/main/stat_tables_disabled.test
+++ b/mysql-test/main/stat_tables_disabled.test
@@ -4,7 +4,9 @@ set @innodb_stats_persistent_sample_pages_save=
set global innodb_stats_persistent= 1;
set global innodb_stats_persistent_sample_pages=100;
+
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';
diff --git a/mysql-test/main/stat_tables_innodb.test b/mysql-test/main/stat_tables_innodb.test
index f439ec52315..fd8dc6bf3c5 100644
--- a/mysql-test/main/stat_tables_innodb.test
+++ b/mysql-test/main/stat_tables_innodb.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc
--source include/have_sequence.inc
diff --git a/mysql-test/main/stat_tables_par_innodb.test b/mysql-test/main/stat_tables_par_innodb.test
index 79ab23dcc3f..024814933c6 100644
--- a/mysql-test/main/stat_tables_par_innodb.test
+++ b/mysql-test/main/stat_tables_par_innodb.test
@@ -1,6 +1,7 @@
# Note that this test requires a fresh restart to not have problems with the
# old status values
+--source include/no_valgrind_without_big.inc
--source include/have_stat_tables.inc
--source include/have_debug_sync.inc
--source include/not_embedded.inc
diff --git a/mysql-test/main/statistics.test b/mysql-test/main/statistics.test
index 1f99aaa33e5..a81de1662f0 100644
--- a/mysql-test/main/statistics.test
+++ b/mysql-test/main/statistics.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
--source include/have_stat_tables.inc
--source include/have_innodb.inc
--disable_warnings
diff --git a/mysql-test/main/subselect_innodb.test b/mysql-test/main/subselect_innodb.test
index 493a7425ea8..b1916b9ec59 100644
--- a/mysql-test/main/subselect_innodb.test
+++ b/mysql-test/main/subselect_innodb.test
@@ -1,3 +1,4 @@
+-- source include/no_valgrind_without_big.inc
-- source include/have_innodb.inc
# Note: the tests uses only non-semijoin subqueries so semi-join switch
diff --git a/mysql-test/main/subselect_sj.test b/mysql-test/main/subselect_sj.test
index c869f56c837..e4d02ed666c 100644
--- a/mysql-test/main/subselect_sj.test
+++ b/mysql-test/main/subselect_sj.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
#
# Nested Loops semi-join subquery evaluation tests
#
diff --git a/mysql-test/main/subselect_sj_jcl6.test b/mysql-test/main/subselect_sj_jcl6.test
index 179c1aa029b..f4f605c0406 100644
--- a/mysql-test/main/subselect_sj_jcl6.test
+++ b/mysql-test/main/subselect_sj_jcl6.test
@@ -1,6 +1,7 @@
#
# Run subselect_sj.test with BKA enabled
#
+--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc
set @save_optimizer_switch_jcl6=@@optimizer_switch;
diff --git a/mysql-test/main/trigger.test b/mysql-test/main/trigger.test
index 32827975e14..16d117e7342 100644
--- a/mysql-test/main/trigger.test
+++ b/mysql-test/main/trigger.test
@@ -1,6 +1,7 @@
# This test uses chmod, can't be run with root permissions
-- source include/not_as_root.inc
---source include/default_charset.inc
+-- source include/no_valgrind_without_big.inc
+-- source include/default_charset.inc
#
# Basic triggers test
diff --git a/mysql-test/main/update_use_source.test b/mysql-test/main/update_use_source.test
index d446bd512dd..1b765138a18 100644
--- a/mysql-test/main/update_use_source.test
+++ b/mysql-test/main/update_use_source.test
@@ -1,5 +1,6 @@
--source include/have_sequence.inc
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
create table t1 (old_c1 integer, old_c2 integer,c1 integer, c2 integer, c3 integer) engine=InnoDB STATS_PERSISTENT=0;
create view v1 as select * from t1 where c2=2;
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index d5fdd1e79f0..65801901e47 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -1,6 +1,7 @@
#
# Window Functions Tests
#
+--source include/no_valgrind_without_big.inc
--source include/have_sequence.inc
--disable_warnings
diff --git a/mysql-test/main/win_big-mdev-11697.test b/mysql-test/main/win_big-mdev-11697.test
index 9488a938554..9016d0d5e0b 100644
--- a/mysql-test/main/win_big-mdev-11697.test
+++ b/mysql-test/main/win_big-mdev-11697.test
@@ -1,3 +1,5 @@
+--source include/no_valgrind_without_big.inc
+
set max_recursive_iterations=200000;
create table test_table (id int, random_data varchar(36), static_int int, static_varchar varchar(10));
diff --git a/mysql-test/std_data/wsrep_notify.sh b/mysql-test/std_data/wsrep_notify.sh
index 48edad4306f..5050ff9bc3e 100755
--- a/mysql-test/std_data/wsrep_notify.sh
+++ b/mysql-test/std_data/wsrep_notify.sh
@@ -4,11 +4,31 @@
# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status'
# and fill them on every membership or node status change.
#
-# Edit parameters below to specify the address and login to server.
-
+# Edit parameters below to specify the address and login to server:
+#
USER=root
+PSWD=
+#
+# If these parameters are not set, then the values
+# passed by the server are taken:
+#
HOST=127.0.0.1
PORT=$NODE_MYPORT_1
+#
+# Edit parameters below to specify SSL parameters:
+#
+ssl_key=
+ssl_cert=
+ssl_ca=
+ssl_capath=
+ssl_cipher=
+ssl_crl=
+ssl_crlpath=
+ssl_verify_server_cert=0
+#
+# Client executable path:
+#
+CLIENT="$EXE_MYSQL"
SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership"
@@ -19,7 +39,7 @@ SET wsrep_on=0;
CREATE SCHEMA IF NOT EXISTS $SCHEMA;
CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
idx INT,
- uuid CHAR(40), /* node UUID */
+ uuid CHAR(40), /* node UUID */
name VARCHAR(32), /* node name */
addr VARCHAR(256) /* node address */
) ENGINE=MEMORY;
@@ -40,7 +60,7 @@ configuration_change()
local idx=0
- for NODE in $(echo $MEMBERS | sed s/,/\ /g)
+ for NODE in $(echo "$MEMBERS" | sed s/,/\ /g)
do
echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
# Don't forget to properly quote string values
@@ -59,17 +79,44 @@ status_update()
echo "$BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
}
+trim_string()
+{
+ if [ -n "${BASH_VERSION:-}" ]; then
+ local pattern="[![:space:]${2:-}]"
+ local x="${1#*$pattern}"
+ local z=${#1}
+ x=${#x}
+ if [ $x -ne $z ]; then
+ local y="${1%$pattern*}"
+ y=${#y}
+ x=$(( z-x-1 ))
+ y=$(( y-x+1 ))
+ printf '%s' "${1:$x:$y}"
+ else
+ printf ''
+ fi
+ else
+ local pattern="[[:space:]${2:-}]"
+ echo "$1" | sed -E "s/^$pattern+|$pattern+\$//g"
+ fi
+}
+
COM=status_update # not a configuration change by default
-while [ $# -gt 0 ]
-do
+STATUS=""
+CLUSTER_UUID=""
+PRIMARY="0"
+INDEX=""
+MEMBERS=""
+
+while [ $# -gt 0 ]; do
case $1 in
--status)
- STATUS=$2
+ STATUS=$(trim_string "$2")
shift
;;
--uuid)
- CLUSTER_UUID=$2
+ CLUSTER_UUID=$(trim_string "$2")
shift
;;
--primary)
@@ -78,22 +125,75 @@ do
shift
;;
--index)
- INDEX=$2
+ INDEX=$(trim_string "$2")
shift
;;
--members)
- MEMBERS=$2
+ MEMBERS=$(trim_string "$2")
shift
;;
esac
shift
done
+USER=$(trim_string "$USER")
+PSWD=$(trim_string "$PSWD")
+
+HOST=$(trim_string "$HOST")
+PORT=$(trim_string "$PORT")
+
+case "$HOST" in
+\[*)
+ HOST="${HOST##\[}"
+ HOST=$(trim_string "${HOST%%\]}")
+ ;;
+esac
+
+if [ -z "$HOST" ]; then
+ HOST="${NOTIFY_HOST:-}"
+fi
+if [ -z "$PORT" ]; then
+ PORT="${NOTIFY_PORT:-}"
+fi
+
+ssl_key=$(trim_string "$ssl_key");
+ssl_cert=$(trim_string "$ssl_cert");
+ssl_ca=$(trim_string "$ssl_ca");
+ssl_capath=$(trim_string "$ssl_capath");
+ssl_cipher=$(trim_string "$ssl_cipher");
+ssl_crl=$(trim_string "$ssl_crl");
+ssl_crlpath=$(trim_string "$ssl_crlpath");
+ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
+
+SSL_PARAM=""
+
+if [ -n "$ssl_key" -o -n "$ssl_cert" -o \
+ -n "$ssl_ca" -o -n "$ssl_capath" -o \
+ -n "$ssl_cipher" ]
+then
+ SSL_PARAM=' --ssl'
+ [ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
+ [ -n "$ssl_cert" ] && SSL_PARAM="$SSL_PARAM --ssl-cert='$ssl_cert'"
+ [ -n "$ssl_ca" ] && SSL_PARAM="$SSL_PARAM --ssl-ca='$ssl_ca'"
+ [ -n "$ssl_capath" ] && SSL_PARAM="$SSL_PARAM --ssl-capath='$ssl_capath'"
+ [ -n "$ssl_cipher" ] && SSL_PARAM="$SSL_PARAM --ssl-cipher='$ssl_cipher'"
+ [ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
+ [ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
+ if [ -n "$ssl_verify_server_cert" ]; then
+ if [ $ssl_verify_server_cert -ne 0 ]; then
+ SSL_PARAM+=' --ssl-verify-server-cert'
+ fi
+ fi
+fi
+
case $STATUS in
"joined" | "donor" | "synced")
- $COM | mysql -B -u$USER -h$HOST -P$PORT
+ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
+ "-h'$HOST'" "-P$PORT"$SSL_PARAM
;;
- *)
- exit 0
+ *)
+ # The node might be shutting down
;;
esac
+
+exit 0
diff --git a/mysql-test/std_data/wsrep_notify_ssl.sh b/mysql-test/std_data/wsrep_notify_ssl.sh
new file mode 100755
index 00000000000..0e416a2f448
--- /dev/null
+++ b/mysql-test/std_data/wsrep_notify_ssl.sh
@@ -0,0 +1,195 @@
+#!/bin/sh -eu
+
+# This is a simple example of wsrep notification script (wsrep_notify_cmd).
+# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status'
+# and fill them on every membership or node status change.
+#
+# Edit parameters below to specify the address and login to server:
+#
+USER=root
+PSWD=
+#
+# If these parameters are not set, then the values
+# passed by the server are taken:
+#
+HOST=127.0.0.1
+PORT=$NODE_MYPORT_1
+#
+# Edit parameters below to specify SSL parameters:
+#
+ssl_cert="$MYSQL_TEST_DIR/std_data/client-cert.pem"
+ssl_key="$MYSQL_TEST_DIR/std_data/client-key.pem"
+ssl_ca="$MYSQL_TEST_DIR/std_data/cacert.pem"
+ssl_capath=
+ssl_cipher=
+ssl_crl=
+ssl_crlpath=
+ssl_verify_server_cert=0
+#
+# Client executable path:
+#
+CLIENT="$EXE_MYSQL"
+
+SCHEMA="mtr_wsrep_notify"
+MEMB_TABLE="$SCHEMA.membership"
+STATUS_TABLE="$SCHEMA.status"
+
+BEGIN="
+SET wsrep_on=0;
+CREATE SCHEMA IF NOT EXISTS $SCHEMA;
+CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
+ idx INT,
+ uuid CHAR(40), /* node UUID */
+ name VARCHAR(32), /* node name */
+ addr VARCHAR(256) /* node address */
+) ENGINE=MEMORY;
+CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
+ size INT, /* component size */
+ idx INT, /* this node index */
+ status CHAR(16), /* this node status */
+ uuid CHAR(40), /* cluster UUID */
+ prim BOOLEAN /* if component is primary */
+) ENGINE=MEMORY;
+BEGIN;
+"
+END="COMMIT;"
+
+configuration_change()
+{
+ echo "$BEGIN;"
+
+ local idx=0
+
+ for NODE in $(echo "$MEMBERS" | sed s/,/\ /g)
+ do
+ echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
+ # Don't forget to properly quote string values
+ echo "'$NODE'" | sed s/\\//\',\'/g
+ echo ");"
+ idx=$(( $idx + 1 ))
+ done
+
+ echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
+
+ echo "$END"
+}
+
+status_update()
+{
+ echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;"
+}
+
+trim_string()
+{
+ if [ -n "${BASH_VERSION:-}" ]; then
+ local pattern="[![:space:]${2:-}]"
+ local x="${1#*$pattern}"
+ local z=${#1}
+ x=${#x}
+ if [ $x -ne $z ]; then
+ local y="${1%$pattern*}"
+ y=${#y}
+ x=$(( z-x-1 ))
+ y=$(( y-x+1 ))
+ printf '%s' "${1:$x:$y}"
+ else
+ printf ''
+ fi
+ else
+ local pattern="[[:space:]${2:-}]"
+ echo "$1" | sed -E "s/^$pattern+|$pattern+\$//g"
+ fi
+}
+
+COM=status_update # not a configuration change by default
+
+STATUS=""
+CLUSTER_UUID=""
+PRIMARY="0"
+INDEX=""
+MEMBERS=""
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ --status)
+ STATUS=$(trim_string "$2")
+ shift
+ ;;
+ --uuid)
+ CLUSTER_UUID=$(trim_string "$2")
+ shift
+ ;;
+ --primary)
+ [ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0"
+ COM=configuration_change
+ shift
+ ;;
+ --index)
+ INDEX=$(trim_string "$2")
+ shift
+ ;;
+ --members)
+ MEMBERS=$(trim_string "$2")
+ shift
+ ;;
+ esac
+ shift
+done
+
+USER=$(trim_string "$USER")
+PSWD=$(trim_string "$PSWD")
+
+HOST=$(trim_string "$HOST")
+PORT=$(trim_string "$PORT")
+
+case "$HOST" in
+\[*)
+ HOST="${HOST##\[}"
+ HOST=$(trim_string "${HOST%%\]}")
+ ;;
+esac
+
+if [ -z "$HOST" ]; then
+ HOST="${NOTIFY_HOST:-}"
+fi
+if [ -z "$PORT" ]; then
+ PORT="${NOTIFY_PORT:-}"
+fi
+
+ssl_key=$(trim_string "$ssl_key");
+ssl_cert=$(trim_string "$ssl_cert");
+ssl_ca=$(trim_string "$ssl_ca");
+ssl_capath=$(trim_string "$ssl_capath");
+ssl_cipher=$(trim_string "$ssl_cipher");
+ssl_crl=$(trim_string "$ssl_crl");
+ssl_crlpath=$(trim_string "$ssl_crlpath");
+ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
+
+SSL_PARAM=""
+
+if [ -n "$ssl_key" -o -n "$ssl_cert" -o \
+ -n "$ssl_ca" -o -n "$ssl_capath" -o \
+ -n "$ssl_cipher" ]
+then
+ SSL_PARAM=' --ssl'
+ [ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
+ [ -n "$ssl_cert" ] && SSL_PARAM="$SSL_PARAM --ssl-cert='$ssl_cert'"
+ [ -n "$ssl_ca" ] && SSL_PARAM="$SSL_PARAM --ssl-ca='$ssl_ca'"
+ [ -n "$ssl_capath" ] && SSL_PARAM="$SSL_PARAM --ssl-capath='$ssl_capath'"
+ [ -n "$ssl_cipher" ] && SSL_PARAM="$SSL_PARAM --ssl-cipher='$ssl_cipher'"
+ [ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
+ [ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
+ if [ -n "$ssl_verify_server_cert" ]; then
+ if [ $ssl_verify_server_cert -ne 0 ]; then
+ SSL_PARAM+=' --ssl-verify-server-cert'
+ fi
+ fi
+fi
+
+# Undefined means node is shutting down
+if [ "$STATUS" != 'Undefined' ]; then
+ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
+ "-h'$HOST'" "-P$PORT"$SSL_PARAM
+fi
+
+exit 0
diff --git a/mysql-test/suite/federated/federatedx_create_handlers.test b/mysql-test/suite/federated/federatedx_create_handlers.test
index 4b5789e1d96..8863a057b47 100644
--- a/mysql-test/suite/federated/federatedx_create_handlers.test
+++ b/mysql-test/suite/federated/federatedx_create_handlers.test
@@ -1,5 +1,6 @@
--source have_federatedx.inc
--source include/federated.inc
+--source include/no_valgrind_without_big.inc
connection default;
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 34da18a9c22..77c2bb9659d 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -29,6 +29,7 @@ galera_var_dirty_reads : MDEV-25615 Galera test failure on galera_var_dirty_read
galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state
galera_var_node_address : MDEV-20485 Galera test failure
galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
+galera_var_notify_ssl_ipv6 : hangs after the merge of MDEV-27682
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
partition : MDEV-19958 Galera test failure on galera.partition
diff --git a/mysql-test/suite/galera/r/galera_var_notify_ssl_ipv6.result b/mysql-test/suite/galera/r/galera_var_notify_ssl_ipv6.result
new file mode 100644
index 00000000000..823407fbba7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_notify_ssl_ipv6.result
@@ -0,0 +1,11 @@
+connection node_1;
+SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
+EXPECT_2
+2
+SELECT MAX(size) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+EXPECT_2
+2
+SELECT COUNT(DISTINCT idx) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+EXPECT_2
+2
+DROP SCHEMA mtr_wsrep_notify;
diff --git a/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6-master.opt b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6-master.opt
new file mode 100644
index 00000000000..99c5889916b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6-master.opt
@@ -0,0 +1 @@
+--wsrep_notify_cmd=$MYSQL_TEST_DIR/std_data/wsrep_notify_ssl.sh --wsrep-sync-wait=0
diff --git a/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf
new file mode 100644
index 00000000000..ce121d20e03
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf
@@ -0,0 +1,20 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem
+ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem
+ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
+bind-address=::
+
+[mysqld.1]
+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;gcache.size=1;pc.ignore_sb=true'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+wsrep_node_address=::1
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_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;gcache.size=1;pc.ignore_sb=true'
+wsrep_node_address=::1
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
diff --git a/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.test b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.test
new file mode 100644
index 00000000000..2c2b106c2ae
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.test
@@ -0,0 +1,20 @@
+#
+# Test wsrep_notify_cmd. We use a version of the support-files/wsrep_notify.sh script that writes
+# notifications into a table.
+#
+
+--source include/galera_cluster.inc
+--source include/have_ssl_communication.inc
+--source include/check_ipv6.inc
+--source include/force_restart.inc
+
+--connection node_1
+--let $wait_condition = SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
+--source include/wait_condition.inc
+
+SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
+SELECT MAX(size) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+SELECT COUNT(DISTINCT idx) AS EXPECT_2 FROM mtr_wsrep_notify.status;
+
+# CLEANUP
+DROP SCHEMA mtr_wsrep_notify;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
index 7835f42b552..3f3b2db8f32 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
@@ -150,10 +150,7 @@ lock table t write;
connection prevent_purge;
commit;
connection default;
-InnoDB 0 transactions not purged
disconnect lock_table;
-start transaction with consistent snapshot;
-commit;
InnoDB 0 transactions not purged
set global debug_dbug=@old_dbug;
drop table t;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
index 2f1f8b29aba..d9b764a75a7 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
@@ -191,10 +191,7 @@ lock table t write;
connection prevent_purge;
commit;
connection default;
---source ../../innodb/include/wait_all_purged.inc
disconnect lock_table;
-start transaction with consistent snapshot;
-commit;
--source ../../innodb/include/wait_all_purged.inc
set global debug_dbug=@old_dbug;
drop table t;
diff --git a/mysql-test/suite/innodb/r/purge_secondary.result b/mysql-test/suite/innodb/r/purge_secondary.result
index a583e46418d..6c0612c7cfe 100644
--- a/mysql-test/suite/innodb/r/purge_secondary.result
+++ b/mysql-test/suite/innodb/r/purge_secondary.result
@@ -154,4 +154,19 @@ WHERE LOWER(variable_name) LIKE 'INNODB_BUFFER_POOL_PAGES_FLUSHED';
# FLUSH TABLES t1 FOR EXPORT;
# UNLOCK TABLES;
DROP TABLE t1;
+#
+# MDEV-29666 InnoDB fails to purge secondary index records
+# when indexed virtual columns exist
+#
+CREATE TABLE t1 (a INT, b INT, a1 INT AS(a) VIRTUAL,
+INDEX(a1),INDEX(b)) ENGINE=InnoDB;
+INSERT INTO t1 SET a=1, b=1;
+UPDATE t1 SET a=2, b=3;
+InnoDB 0 transactions not purged
+FLUSH TABLE t1 FOR EXPORT;
+page 4: N_RECS=0x0001
+page 5: N_RECS=0x0001
+UNLOCK TABLES;
+DROP TABLE t1;
+# End of 10.3 tests
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/innodb/t/alter_large_dml.test b/mysql-test/suite/innodb/t/alter_large_dml.test
index d8b288e5a9f..7320fa008af 100644
--- a/mysql-test/suite/innodb/t/alter_large_dml.test
+++ b/mysql-test/suite/innodb/t/alter_large_dml.test
@@ -5,6 +5,8 @@
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/have_sequence.inc
+# This test often times out with MemorySanitizer.
+--source include/not_msan.inc
CREATE TABLE t1(f1 char(200), f2 char(200), f3 char(200),
f4 char(200), f5 char(200), f6 char(200),
diff --git a/mysql-test/suite/innodb/t/alter_missing_tablespace.test b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
index bf7111509bd..bac1b1dcdcf 100644
--- a/mysql-test/suite/innodb/t/alter_missing_tablespace.test
+++ b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
@@ -1,5 +1,6 @@
--source include/not_embedded.inc
--source include/innodb_page_size.inc
+--source include/no_valgrind_without_big.inc
--echo #
--echo # Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING
diff --git a/mysql-test/suite/innodb/t/autoinc_persist.test b/mysql-test/suite/innodb/t/autoinc_persist.test
index 6e094b40e02..a2832bd5187 100644
--- a/mysql-test/suite/innodb/t/autoinc_persist.test
+++ b/mysql-test/suite/innodb/t/autoinc_persist.test
@@ -1,6 +1,7 @@
--source include/have_innodb.inc
# Restarting is not supported when testing the embedded server.
--source include/not_embedded.inc
+--source include/no_valgrind_without_big.inc
--echo #
--echo # MDEV-6076 Persistent AUTO_INCREMENT for InnoDB
diff --git a/mysql-test/suite/innodb/t/ibuf_not_empty.test b/mysql-test/suite/innodb/t/ibuf_not_empty.test
index 96ceb81ac00..207427d9ab8 100644
--- a/mysql-test/suite/innodb/t/ibuf_not_empty.test
+++ b/mysql-test/suite/innodb/t/ibuf_not_empty.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
# innodb_change_buffering_debug option is debug only
--source include/have_debug.inc
# Embedded server tests do not support restarting
diff --git a/mysql-test/suite/innodb/t/innodb-get-fk.test b/mysql-test/suite/innodb/t/innodb-get-fk.test
index 47db92a0c6d..b4b170b89f9 100644
--- a/mysql-test/suite/innodb/t/innodb-get-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-get-fk.test
@@ -2,6 +2,8 @@
--source include/default_charset.inc
# need to restart server
--source include/not_embedded.inc
+--source include/no_valgrind_without_big.inc
+
CREATE SCHEMA `repro`;
CREATE TABLE `repro`.`crew` (
diff --git a/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test b/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test
index d5d04190b8a..ba37e82057f 100644
--- a/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test
+++ b/mysql-test/suite/innodb/t/innodb-stats-initialize-failure.test
@@ -1,5 +1,6 @@
# MDEV-6424: Mariadb server crashes with assertion failure in file ha_innodb.cc
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
# DEBUG_SYNC must be compiled in.
--source include/have_debug_sync.inc
diff --git a/mysql-test/suite/innodb/t/innodb-stats-sample.test b/mysql-test/suite/innodb/t/innodb-stats-sample.test
index 600688ab98d..34ca4c7b58e 100644
--- a/mysql-test/suite/innodb/t/innodb-stats-sample.test
+++ b/mysql-test/suite/innodb/t/innodb-stats-sample.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
#
# Test that mysqld does not crash when running ANALYZE TABLE with
# different values of the parameter innodb_stats_transient_sample_pages.
diff --git a/mysql-test/suite/innodb/t/innodb-trim.test b/mysql-test/suite/innodb/t/innodb-trim.test
index 3f8eb5f2c71..a077e6acafe 100644
--- a/mysql-test/suite/innodb/t/innodb-trim.test
+++ b/mysql-test/suite/innodb/t/innodb-trim.test
@@ -1,5 +1,6 @@
--source include/have_innodb.inc
--source include/have_innodb_punchhole.inc
+--source include/no_valgrind_without_big.inc
--disable_query_log
--disable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb_bug30423.test b/mysql-test/suite/innodb/t/innodb_bug30423.test
index de53a935156..9d9975c04ca 100644
--- a/mysql-test/suite/innodb/t/innodb_bug30423.test
+++ b/mysql-test/suite/innodb/t/innodb_bug30423.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
# Test for Bug #30423, InnoDBs treatment of NULL in index stats causes
# bad "rows examined" estimates.
# Implemented InnoDB system variable "innodb_stats_method" with
diff --git a/mysql-test/suite/innodb/t/innodb_bug53290.test b/mysql-test/suite/innodb/t/innodb_bug53290.test
index ea15212fa39..9d36d9bd2f6 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53290.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53290.test
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
+-- source include/no_valgrind_without_big.inc
create table bug53290 (x bigint) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/log_corruption.test b/mysql-test/suite/innodb/t/log_corruption.test
index b9162be99db..46f6384b3c9 100644
--- a/mysql-test/suite/innodb/t/log_corruption.test
+++ b/mysql-test/suite/innodb/t/log_corruption.test
@@ -1,5 +1,6 @@
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
+--source include/no_valgrind_without_big.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Upgrade after a crash is not supported");
diff --git a/mysql-test/suite/innodb/t/log_file.test b/mysql-test/suite/innodb/t/log_file.test
index e167bc6fb57..2484e787973 100644
--- a/mysql-test/suite/innodb/t/log_file.test
+++ b/mysql-test/suite/innodb/t/log_file.test
@@ -3,6 +3,7 @@
--echo # Bug#16418661 - CHANGING NAME IN FOR INNODB_DATA_FILE_PATH SHOULD NOT SUCCEED WITH LOG FILES
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Could not create undo tablespace.*undo002");
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index 2a7ed7b494d..89fe04bcdfb 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -2,7 +2,7 @@
# Test the detection of duplicate tablespaces.
--source include/have_innodb.inc
---source include/not_valgrind.inc
+--source include/no_valgrind_without_big.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
diff --git a/mysql-test/suite/innodb/t/missing_tablespaces.test b/mysql-test/suite/innodb/t/missing_tablespaces.test
index 8dc325b3356..92f963a262d 100644
--- a/mysql-test/suite/innodb/t/missing_tablespaces.test
+++ b/mysql-test/suite/innodb/t/missing_tablespaces.test
@@ -4,6 +4,7 @@
--source include/not_embedded.inc
#Windows has trouble creating files/directories with long names
--source include/not_windows.inc
+--source include/no_valgrind_without_big.inc
--echo #
--echo # Bug#19419026 WHEN A TABLESPACE IS NOT FOUND, DO NOT REPORT "TABLE NOT FOUND"
diff --git a/mysql-test/suite/innodb/t/purge_secondary.test b/mysql-test/suite/innodb/t/purge_secondary.test
index f2c85ce10e7..1a0d178f66a 100644
--- a/mysql-test/suite/innodb/t/purge_secondary.test
+++ b/mysql-test/suite/innodb/t/purge_secondary.test
@@ -139,4 +139,36 @@ WHERE LOWER(variable_name) LIKE 'INNODB_BUFFER_POOL_PAGES_FLUSHED';
DROP TABLE t1;
+--echo #
+--echo # MDEV-29666 InnoDB fails to purge secondary index records
+--echo # when indexed virtual columns exist
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, a1 INT AS(a) VIRTUAL,
+INDEX(a1),INDEX(b)) ENGINE=InnoDB;
+INSERT INTO t1 SET a=1, b=1;
+
+UPDATE t1 SET a=2, b=3;
+let DATADIR=`select @@datadir`;
+let PAGE_SIZE=`select @@innodb_page_size`;
+
+source include/wait_all_purged.inc;
+FLUSH TABLE t1 FOR EXPORT;
+
+perl;
+my $ps = $ENV{PAGE_SIZE};
+my $file = "$ENV{DATADIR}/test/t1.ibd";
+open(FILE, "<", $file) or die "Unable to open $file\n";
+die "Unable to read $file\n" unless
+ sysread(FILE, $_, 6*$ps) == 6*$ps;
+close(FILE);
+print "page 4: N_RECS=0x", unpack("H*", substr($_, 4 * $ps + 54, 2)), "\n";
+print "page 5: N_RECS=0x", unpack("H*", substr($_, 5 * $ps + 54, 2)), "\n";
+EOF
+
+UNLOCK TABLES;
+DROP TABLE t1;
+
+--echo # End of 10.3 tests
+
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/innodb/t/read_only_recover_committed.test b/mysql-test/suite/innodb/t/read_only_recover_committed.test
index 1d2270315c5..d61fbd3c522 100644
--- a/mysql-test/suite/innodb/t/read_only_recover_committed.test
+++ b/mysql-test/suite/innodb/t/read_only_recover_committed.test
@@ -1,6 +1,7 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
+--source include/no_valgrind_without_big.inc
# need to restart server
--source include/not_embedded.inc
--source include/no_valgrind_without_big.inc
diff --git a/mysql-test/suite/innodb/t/recovery_shutdown.test b/mysql-test/suite/innodb/t/recovery_shutdown.test
index 85e49b255d3..968ea62833a 100644
--- a/mysql-test/suite/innodb/t/recovery_shutdown.test
+++ b/mysql-test/suite/innodb/t/recovery_shutdown.test
@@ -1,5 +1,6 @@
--source include/have_innodb.inc
--source include/not_embedded.inc
+--source include/no_valgrind_without_big.inc
--source include/have_sequence.inc
# Flush any open myisam tables from previous tests
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
index d36e71b797a..6b2e6ee3ea6 100644
--- a/mysql-test/suite/innodb/t/table_flags.test
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -1,7 +1,12 @@
--source include/innodb_page_size.inc
# Embedded server tests do not support restarting
--source include/not_embedded.inc
---source include/no_valgrind_without_big.inc
+# Slow shutdown may take more than 120 seconds under Valgrind,
+# causing the server to be (silently) killed.
+# Due to that, crash recovery could "heal" the damage that our
+# Perl code is inflicting, and the SELECT statements could succeed
+# instead of failing with ER_NO_SUCH_TABLE_IN_ENGINE.
+--source include/not_valgrind.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found");
diff --git a/mysql-test/suite/innodb/t/undo_truncate.test b/mysql-test/suite/innodb/t/undo_truncate.test
index d954ff28307..19829ce21e7 100644
--- a/mysql-test/suite/innodb/t/undo_truncate.test
+++ b/mysql-test/suite/innodb/t/undo_truncate.test
@@ -3,6 +3,7 @@
--source include/have_undo_tablespaces.inc
--source include/not_embedded.inc
--source include/have_sequence.inc
+--source include/no_valgrind_without_big.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
index 279cca3177a..b194ad20f71 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
@@ -3,6 +3,7 @@
#-----------------------------------------------------------------------------
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
--source include/default_charset.inc
let collation=UTF8_UNICODE_CI;
--source include/have_collation.inc
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test
index 6a7ad8c7d82..7ff36b6f4b6 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test
@@ -1,5 +1,6 @@
--source include/have_innodb.inc
--source include/have_simple_parser.inc
+--source include/no_valgrind_without_big.inc
# Restart is not supported in embedded
--source include/not_embedded.inc
diff --git a/mysql-test/suite/mariabackup/log_page_corruption.test b/mysql-test/suite/mariabackup/log_page_corruption.test
index 8931eb1eaf7..b9b3a6e6a7b 100644
--- a/mysql-test/suite/mariabackup/log_page_corruption.test
+++ b/mysql-test/suite/mariabackup/log_page_corruption.test
@@ -1,4 +1,5 @@
--source include/have_debug.inc
+--source include/no_valgrind_without_big.inc
--echo ########
--echo # Test for generating "innodb_corrupted_pages" file during full and
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test
index 4e1df63b45b..69181c3615c 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test
@@ -4,6 +4,7 @@
--source include/have_debug.inc
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
SET @saved_dbug = @@SESSION.debug_dbug;
# crash requires ICP support in InnoDB
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
index 4a192230859..2cf184a3401 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
@@ -5,6 +5,7 @@ if (`SELECT $PS_PROTOCOL != 0`)
--let $rpl_topology=1->2
--source include/rpl_init.inc
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
--echo *** Test normal shutdown/restart of slave server configured as a GTID slave. ***
diff --git a/mysql-test/suite/rpl/t/rpl_mdev12179.test b/mysql-test/suite/rpl/t/rpl_mdev12179.test
index 2afcbf7b1e1..c8b9e665747 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev12179.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev12179.test
@@ -1,6 +1,7 @@
--source include/have_innodb.inc
--let $rpl_topology=1->2
--source include/rpl_init.inc
+--source include/no_valgrind_without_big.inc
--connection server_2
call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase");
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_await_ack.test b/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_await_ack.test
index 5e9cda6466e..2ee7d0aa052 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_await_ack.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_await_ack.test
@@ -1,3 +1,5 @@
+--source include/no_valgrind_without_big.inc
+
#
# Purpose:
# This test validates that data is consistent between a primary and replica
diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test
index 083ec43e7d7..d5e23124b4b 100644
--- a/mysql-test/suite/stress/t/ddl_innodb.test
+++ b/mysql-test/suite/stress/t/ddl_innodb.test
@@ -1,3 +1,4 @@
+--source include/no_valgrind_without_big.inc
######## t/ddl_innodb.test ######
#
# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test
index feb7bf05638..072d1cec1a4 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test
@@ -5,6 +5,7 @@
-- source include/have_innodb.inc
# include/restart_mysqld.inc does not work in embedded mode
-- source include/not_embedded.inc
+-- source include/no_valgrind_without_big.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_dump_at_shutdown;
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_method_func.test b/mysql-test/suite/sys_vars/t/innodb_flush_method_func.test
index aad91d0f4a3..7293a99db41 100644
--- a/mysql-test/suite/sys_vars/t/innodb_flush_method_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_method_func.test
@@ -1,6 +1,8 @@
--source include/have_innodb.inc
# Embedded server tests do not support restarting.
--source include/not_embedded.inc
+# InnoDB: Cannot read first page of './ibdata1' I/O error
+--source include/not_valgrind.inc
call mtr.add_suppression("InnoDB: Failed to set .*DIRECT");
--replace_result unbuffered fsync
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index a0d32145abe..4c853689504 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -415,13 +415,9 @@ void field_real::add()
}
else
{
-#ifdef HAVE_SNPRINTF
buff[sizeof(buff)-1]=0; // Safety
snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num);
length = (uint) strlen(buff);
-#else
- length= snprintf(buff, sizeof(buff), "%-.*f", (int) decs, num);
-#endif
// We never need to check further than this
end = buff + length - 1 - decs + max_notzero_dec_len;
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index ae769715a3b..1595ae917b5 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -753,7 +753,7 @@ btr_page_get_father_node_ptr_func(
user_rec, 0,
heap, level),
PAGE_CUR_LE, latch_mode,
- cursor, 0, mtr) != DB_SUCCESS) {
+ cursor, mtr) != DB_SUCCESS) {
return nullptr;
}
@@ -2379,7 +2379,7 @@ btr_insert_on_non_leaf_level(
dberr_t err = btr_cur_search_to_nth_level(index, level, tuple, mode,
BTR_CONT_MODIFY_TREE,
- &cursor, 0, mtr);
+ &cursor, mtr);
ut_ad(cursor.flag == BTR_CUR_BINARY);
if (UNIV_LIKELY(err == DB_SUCCESS)) {
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index e9b4e2937b9..d52f061827f 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1210,36 +1210,31 @@ If mode is PAGE_CUR_GE, then up_match will a have a sensible value.
If mode is PAGE_CUR_LE , cursor is left at the place where an insert of the
search tuple should be performed in the B-tree. InnoDB does an insert
immediately after the cursor. Thus, the cursor may end up on a user record,
-or on a page infimum record. */
+or on a page infimum record.
+@param index index
+@param level the tree level of search
+@param tuple data tuple; NOTE: n_fields_cmp in tuple must be set so that
+ it cannot get compared to the node ptr page number field!
+@param mode PAGE_CUR_L, ...; NOTE that if the search is made using a
+ unique prefix of a record, mode should be PAGE_CUR_LE, not
+ PAGE_CUR_GE, as the latter may end up on the previous page of
+ the record! Inserts should always be made using PAGE_CUR_LE
+ to search the position!
+@param latch_mode BTR_SEARCH_LEAF, ..., ORed with at most one of BTR_INSERT,
+ BTR_DELETE_MARK, or BTR_DELETE;
+ cursor->left_block is used to store a pointer to the left
+ neighbor page
+@param cursor tree cursor; the cursor page is s- or x-latched, but see also
+ above!
+@param mtr mini-transaction
+@param autoinc PAGE_ROOT_AUTO_INC to be written (0 if none)
+@return DB_SUCCESS on success or error code otherwise */
TRANSACTIONAL_TARGET
-dberr_t
-btr_cur_search_to_nth_level_func(
- dict_index_t* index, /*!< in: index */
- ulint level, /*!< in: the tree level of search */
- const dtuple_t* tuple, /*!< in: data tuple; NOTE: n_fields_cmp in
- tuple must be set so that it cannot get
- compared to the node ptr page number field! */
- page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...;
- Inserts should always be made using
- PAGE_CUR_LE to search the position! */
- ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ..., ORed with
- at most one of BTR_INSERT, BTR_DELETE_MARK,
- BTR_DELETE;
- cursor->left_block is used to store a pointer
- to the left neighbor page, in the cases
- BTR_SEARCH_PREV and BTR_MODIFY_PREV;
- NOTE that if ahi_latch, we might not have a
- cursor page latch, we assume that ahi_latch
- protects the record! */
- btr_cur_t* cursor, /*!< in/out: tree cursor; the cursor page is
- s- or x-latched, but see also above! */
-#ifdef BTR_CUR_HASH_ADAPT
- srw_spin_lock* ahi_latch,
- /*!< in: currently held AHI rdlock, or NULL */
-#endif /* BTR_CUR_HASH_ADAPT */
- mtr_t* mtr, /*!< in: mtr */
- ib_uint64_t autoinc)/*!< in: PAGE_ROOT_AUTO_INC to be written
- (0 if none) */
+dberr_t btr_cur_search_to_nth_level(dict_index_t *index, ulint level,
+ const dtuple_t *tuple,
+ page_cur_mode_t mode, ulint latch_mode,
+ btr_cur_t *cursor, mtr_t *mtr,
+ ib_uint64_t autoinc)
{
page_t* page = NULL; /* remove warning */
buf_block_t* block;
@@ -1381,14 +1376,12 @@ btr_cur_search_to_nth_level_func(
# ifdef UNIV_SEARCH_PERF_STAT
info->n_searches++;
# endif
+ /* We do a dirty read of btr_search_enabled below,
+ and btr_search_guess_on_hash() will have to check it again. */
if (!btr_search_enabled) {
} else if (autoinc == 0
&& latch_mode <= BTR_MODIFY_LEAF
&& !modify_external
- /* If !ahi_latch, we do a dirty read of
- btr_search_enabled below, and btr_search_guess_on_hash()
- will have to check it again. */
- && btr_search_enabled
# ifdef PAGE_CUR_LE_OR_EXTENDS
&& mode != PAGE_CUR_LE_OR_EXTENDS
# endif /* PAGE_CUR_LE_OR_EXTENDS */
@@ -1396,8 +1389,7 @@ btr_cur_search_to_nth_level_func(
&& !(tuple->info_bits & REC_INFO_MIN_REC_FLAG)
&& !index->is_spatial() && !index->table->is_temporary()
&& btr_search_guess_on_hash(index, info, tuple, mode,
- latch_mode, cursor,
- ahi_latch, mtr)) {
+ latch_mode, cursor, mtr)) {
/* Search using the hash index succeeded */
@@ -1419,13 +1411,6 @@ btr_cur_search_to_nth_level_func(
/* If the hash search did not succeed, do binary search down the
tree */
-#ifdef BTR_CUR_HASH_ADAPT
- if (ahi_latch) {
- /* Release possible search latch to obey latching order */
- ahi_latch->rd_unlock();
- }
-#endif /* BTR_CUR_HASH_ADAPT */
-
/* Store the position of the tree latch we push to mtr so that we
know how to release it when we have latched leaf node(s) */
@@ -2460,12 +2445,6 @@ func_exit:
cursor->rtr_info->mbr_adj = true;
}
-#ifdef BTR_CUR_HASH_ADAPT
- if (ahi_latch) {
- ahi_latch->rd_lock(SRW_LOCK_CALL);
- }
-#endif /* BTR_CUR_HASH_ADAPT */
-
DBUG_RETURN(err);
}
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc
index eb7f452749f..0e6aaa0d6b2 100644
--- a/storage/innobase/btr/btr0pcur.cc
+++ b/storage/innobase/btr/btr0pcur.cc
@@ -420,13 +420,8 @@ btr_pcur_t::restore_position(ulint restore_latch_mode, mtr_t *mtr)
mode = PAGE_CUR_UNSUPP;
}
- if (btr_pcur_open_with_no_init_func(
- index, tuple, mode, restore_latch_mode,
- this,
-#ifdef BTR_CUR_HASH_ADAPT
- nullptr,
-#endif /* BTR_CUR_HASH_ADAPT */
- mtr) != DB_SUCCESS) {
+ if (btr_pcur_open_with_no_init(index, tuple, mode, restore_latch_mode,
+ this, mtr) != DB_SUCCESS) {
mem_heap_free(heap);
return restore_status::CORRUPTED;
}
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 5b35c7f4f97..29345cf0104 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -1036,15 +1036,9 @@ both have sensible values.
@param[in,out] info index search info
@param[in] tuple logical record
@param[in] mode PAGE_CUR_L, ....
-@param[in] latch_mode BTR_SEARCH_LEAF, ...;
- NOTE that only if has_search_latch is 0, we will
- have a latch set on the cursor page, otherwise
- we assume the caller uses his search latch
- to protect the record!
+@param[in] latch_mode BTR_SEARCH_LEAF, ...
@param[out] cursor tree cursor
-@param[in] ahi_latch the adaptive hash index latch being held,
- or NULL
-@param[in] mtr mini transaction
+@param[in] mtr mini-transaction
@return whether the search succeeded */
TRANSACTIONAL_TARGET
bool
@@ -1055,7 +1049,6 @@ btr_search_guess_on_hash(
ulint mode,
ulint latch_mode,
btr_cur_t* cursor,
- srw_spin_lock* ahi_latch,
mtr_t* mtr)
{
ulint fold;
@@ -1068,8 +1061,6 @@ btr_search_guess_on_hash(
}
ut_ad(!index->is_ibuf());
- ut_ad(!ahi_latch
- || ahi_latch == &btr_search_sys.get_part(*index)->latch);
ut_ad(latch_mode == BTR_SEARCH_LEAF || latch_mode == BTR_MODIFY_LEAF);
compile_time_assert(ulint{BTR_SEARCH_LEAF} == ulint{RW_S_LATCH});
compile_time_assert(ulint{BTR_MODIFY_LEAF} == ulint{RW_X_LATCH});
@@ -1104,24 +1095,18 @@ btr_search_guess_on_hash(
auto part = btr_search_sys.get_part(*index);
const rec_t* rec;
- if (!ahi_latch) {
- part->latch.rd_lock(SRW_LOCK_CALL);
+ part->latch.rd_lock(SRW_LOCK_CALL);
- if (!btr_search_enabled) {
- goto fail;
- }
- } else {
- ut_ad(btr_search_enabled);
+ if (!btr_search_enabled) {
+ goto fail;
}
rec = static_cast<const rec_t*>(
ha_search_and_get_data(&part->table, fold));
if (!rec) {
- if (!ahi_latch) {
fail:
- part->latch.rd_unlock();
- }
+ part->latch.rd_unlock();
btr_search_failure(info, cursor);
return false;
@@ -1129,74 +1114,64 @@ fail:
buf_block_t* block = buf_pool.block_from_ahi(rec);
- if (!ahi_latch) {
- buf_pool_t::hash_chain& chain = buf_pool.page_hash.cell_get(
- block->page.id().fold());
- bool fail, got_latch;
- {
- transactional_shared_lock_guard<page_hash_latch> g{
- buf_pool.page_hash.lock_get(chain)};
-
- const auto state = block->page.state();
- if (state == buf_page_t::REMOVE_HASH) {
- /* Another thread is just freeing the block
- from the LRU list of the buffer pool: do not
- try to access this page. */
- goto fail;
- }
- if (UNIV_UNLIKELY(state < buf_page_t::UNFIXED)) {
+ buf_pool_t::hash_chain& chain = buf_pool.page_hash.cell_get(
+ block->page.id().fold());
+ bool fail, got_latch;
+ {
+ transactional_shared_lock_guard<page_hash_latch> g{
+ buf_pool.page_hash.lock_get(chain)};
+
+ const auto state = block->page.state();
+ if (state == buf_page_t::REMOVE_HASH) {
+ /* Another thread is just freeing the block
+ from the LRU list of the buffer pool: do not
+ try to access this page. */
+ goto fail;
+ }
+ if (UNIV_UNLIKELY(state < buf_page_t::UNFIXED)) {
#ifndef NO_ELISION
- xend();
+ xend();
#endif
- ut_error;
- }
-
- fail = index != block->index
- && index_id == block->index->id;
- got_latch = (latch_mode == BTR_SEARCH_LEAF)
- ? block->page.lock.s_lock_try()
- : block->page.lock.x_lock_try();
+ ut_error;
}
- ut_a(!fail || block->index->freed());
- if (!got_latch) {
- goto fail;
- }
+ fail = index != block->index && index_id == block->index->id;
+ got_latch = (latch_mode == BTR_SEARCH_LEAF)
+ ? block->page.lock.s_lock_try()
+ : block->page.lock.x_lock_try();
+ }
- block->page.fix();
- block->page.set_accessed();
- buf_page_make_young_if_needed(&block->page);
- ut_ad(!block->page.is_read_fixed());
- ut_ad(latch_mode == BTR_SEARCH_LEAF
- || !block->page.is_io_fixed());
- static_assert(ulint{MTR_MEMO_PAGE_S_FIX} ==
- ulint{BTR_SEARCH_LEAF}, "");
- static_assert(ulint{MTR_MEMO_PAGE_X_FIX} ==
- ulint{BTR_MODIFY_LEAF}, "");
- mtr->memo_push(block, mtr_memo_type_t(latch_mode));
+ ut_a(!fail || block->index->freed());
+ if (!got_latch) {
+ goto fail;
+ }
- ++buf_pool.stat.n_page_gets;
+ block->page.fix();
+ block->page.set_accessed();
+ buf_page_make_young_if_needed(&block->page);
+ ut_ad(!block->page.is_read_fixed());
+ ut_ad(latch_mode == BTR_SEARCH_LEAF || !block->page.is_io_fixed());
+ static_assert(ulint{MTR_MEMO_PAGE_S_FIX} == ulint{BTR_SEARCH_LEAF},
+ "");
+ static_assert(ulint{MTR_MEMO_PAGE_X_FIX} == ulint{BTR_MODIFY_LEAF},
+ "");
+ mtr->memo_push(block, mtr_memo_type_t(latch_mode));
- part->latch.rd_unlock();
+ ++buf_pool.stat.n_page_gets;
- if (UNIV_UNLIKELY(fail)) {
- goto fail_and_release_page;
- }
+ part->latch.rd_unlock();
- DBUG_ASSERT(!block->page.is_freed());
- } else if (UNIV_UNLIKELY(index != block->index
- && index_id == block->index->id)) {
- ut_a(block->index->freed());
+ if (UNIV_UNLIKELY(fail)) {
goto fail_and_release_page;
}
+ DBUG_ASSERT(!block->page.is_freed());
+
if (!block->page.in_file()) {
ut_ad(block->page.state() == buf_page_t::REMOVE_HASH);
fail_and_release_page:
- if (!ahi_latch) {
- btr_leaf_page_release(block, latch_mode, mtr);
- }
+ btr_leaf_page_release(block, latch_mode, mtr);
btr_search_failure(info, cursor);
return false;
@@ -1214,7 +1189,7 @@ fail_and_release_page:
record to determine if our guess for the cursor position is
right. */
if (index_id != btr_page_get_index_id(block->page.frame)
- || !btr_search_check_guess(cursor, !!ahi_latch, tuple, mode)) {
+ || !btr_search_check_guess(cursor, false, tuple, mode)) {
goto fail_and_release_page;
}
@@ -1263,14 +1238,6 @@ fail_and_release_page:
#ifdef UNIV_SEARCH_PERF_STAT
btr_search_n_succ++;
#endif
- /* Increment the page get statistics though we did not really
- fix the page: for user info only */
- ++buf_pool.stat.n_page_gets;
-
- if (!ahi_latch) {
- buf_page_make_young_if_needed(&block->page);
- }
-
return true;
}
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 69245deca72..b74cd043439 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -4153,7 +4153,7 @@ void dict_set_corrupted(dict_index_t *index, const char *ctx)
dict_index_copy_types(tuple, sys_index, 2);
if (btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE,
- BTR_MODIFY_LEAF, &cursor, 0, &mtr)
+ BTR_MODIFY_LEAF, &cursor, &mtr)
!= DB_SUCCESS) {
goto fail;
}
@@ -4228,7 +4228,7 @@ dict_index_set_merge_threshold(
dict_index_copy_types(tuple, sys_index, 2);
if (btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE,
- BTR_MODIFY_LEAF, &cursor, 0, &mtr)
+ BTR_MODIFY_LEAF, &cursor, &mtr)
!= DB_SUCCESS) {
goto func_exit;
}
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index df60a2aadd1..31c6523c700 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -3354,7 +3354,7 @@ fts_add_doc_by_id(
/* If we have a match, add the data to doc structure */
if (btr_pcur_open_with_no_init(fts_id_index, tuple, PAGE_CUR_LE,
- BTR_SEARCH_LEAF, &pcur, 0, &mtr)
+ BTR_SEARCH_LEAF, &pcur, &mtr)
== DB_SUCCESS
&& btr_pcur_get_low_match(&pcur) == 1) {
const rec_t* rec;
@@ -3392,7 +3392,7 @@ fts_add_doc_by_id(
if (btr_pcur_open_with_no_init(clust_index, clust_ref,
PAGE_CUR_LE,
BTR_SEARCH_LEAF,
- &clust_pcur, 0, &mtr)
+ &clust_pcur, &mtr)
!= DB_SUCCESS) {
goto func_exit;
}
diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc
index 9a378d531d9..78d0a5b9705 100644
--- a/storage/innobase/gis/gis0sea.cc
+++ b/storage/innobase/gis/gis0sea.cc
@@ -556,7 +556,7 @@ rtr_pcur_open(
if (btr_cur_search_to_nth_level(index, 0, tuple, PAGE_CUR_RTREE_LOCATE,
latch_mode,
- btr_cursor, 0, mtr) != DB_SUCCESS) {
+ btr_cursor, mtr) != DB_SUCCESS) {
return true;
}
@@ -682,7 +682,7 @@ static const rec_t* rtr_get_father_node(
if (btr_cur_search_to_nth_level(index, level, tuple,
PAGE_CUR_RTREE_LOCATE,
- BTR_CONT_MODIFY_TREE, btr_cur, 0, mtr)
+ BTR_CONT_MODIFY_TREE, btr_cur, mtr)
!= DB_SUCCESS) {
} else if (sea_cur && sea_cur->tree_height == level) {
rec = btr_cur_get_rec(btr_cur);
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index bbf7ab40d7e..6626b2e948a 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -142,53 +142,35 @@ btr_cur_optimistic_latch_leaves(
mtr_t* mtr);
MY_ATTRIBUTE((warn_unused_result))
-/********************************************************************//**
-Searches an index tree and positions a tree cursor on a given level.
+/** Searches an index tree and positions a tree cursor on a given level.
NOTE: n_fields_cmp in tuple must be set so that it cannot be compared
to node pointer page number fields on the upper levels of the tree!
Note that if mode is PAGE_CUR_LE, which is used in inserts, then
cursor->up_match and cursor->low_match both will have sensible values.
-If mode is PAGE_CUR_GE, then up_match will a have a sensible value. */
-dberr_t
-btr_cur_search_to_nth_level_func(
- dict_index_t* index, /*!< in: index */
- ulint level, /*!< in: the tree level of search */
- const dtuple_t* tuple, /*!< in: data tuple; NOTE: n_fields_cmp in
- tuple must be set so that it cannot get
- compared to the node ptr page number field! */
- page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...;
- NOTE that if the search is made using a unique
- prefix of a record, mode should be PAGE_CUR_LE,
- not PAGE_CUR_GE, as the latter may end up on
- the previous page of the record! Inserts
- should always be made using PAGE_CUR_LE to
- search the position! */
- ulint latch_mode, /*!< in: BTR_SEARCH_LEAF, ..., ORed with
- at most one of BTR_INSERT, BTR_DELETE_MARK,
- BTR_DELETE;
- cursor->left_block is used to store a pointer
- to the left neighbor page, in the cases
- BTR_SEARCH_PREV and BTR_MODIFY_PREV;
- NOTE that if ahi_latch, we might not have a
- cursor page latch, we assume that ahi_latch
- protects the record! */
- btr_cur_t* cursor, /*!< in/out: tree cursor; the cursor page is
- s- or x-latched, but see also above! */
-#ifdef BTR_CUR_HASH_ADAPT
- srw_spin_lock* ahi_latch,
- /*!< in: currently held AHI rdlock, or NULL */
-#endif /* BTR_CUR_HASH_ADAPT */
- mtr_t* mtr, /*!< in/out: mini-transaction */
- ib_uint64_t autoinc = 0);
- /*!< in: PAGE_ROOT_AUTO_INC to be written
- (0 if none) */
-#ifdef BTR_CUR_HASH_ADAPT
-# define btr_cur_search_to_nth_level(i,l,t,m,lm,c,a,mtr) \
- btr_cur_search_to_nth_level_func(i,l,t,m,lm,c,a,mtr)
-#else /* BTR_CUR_HASH_ADAPT */
-# define btr_cur_search_to_nth_level(i,l,t,m,lm,c,a,mtr) \
- btr_cur_search_to_nth_level_func(i,l,t,m,lm,c,mtr)
-#endif /* BTR_CUR_HASH_ADAPT */
+If mode is PAGE_CUR_GE, then up_match will a have a sensible value.
+@param index index
+@param level the tree level of search
+@param tuple data tuple; NOTE: n_fields_cmp in tuple must be set so that
+ it cannot get compared to the node ptr page number field!
+@param mode PAGE_CUR_L, ...; NOTE that if the search is made using a
+ unique prefix of a record, mode should be PAGE_CUR_LE, not
+ PAGE_CUR_GE, as the latter may end up on the previous page of
+ the record! Inserts should always be made using PAGE_CUR_LE
+ to search the position!
+@param latch_mode BTR_SEARCH_LEAF, ..., ORed with at most one of BTR_INSERT,
+ BTR_DELETE_MARK, or BTR_DELETE;
+ cursor->left_block is used to store a pointer to the left
+ neighbor page
+@param cursor tree cursor; the cursor page is s- or x-latched, but see also
+ above!
+@param mtr mini-transaction
+@param autoinc PAGE_ROOT_AUTO_INC to be written (0 if none)
+@return DB_SUCCESS on success or error code otherwise */
+dberr_t btr_cur_search_to_nth_level(dict_index_t *index, ulint level,
+ const dtuple_t *tuple,
+ page_cur_mode_t mode, ulint latch_mode,
+ btr_cur_t *cursor, mtr_t *mtr,
+ ib_uint64_t autoinc= 0);
/*****************************************************************//**
Opens a cursor at either end of an index.
diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h
index 2d8f6d1024f..5103484da29 100644
--- a/storage/innobase/include/btr0pcur.h
+++ b/storage/innobase/include/btr0pcur.h
@@ -113,39 +113,22 @@ btr_pcur_open_low(
MY_ATTRIBUTE((nonnull, warn_unused_result));
#define btr_pcur_open(i,t,md,l,c,m) \
btr_pcur_open_low(i,0,t,md,l,c,0,m)
-/**************************************************************//**
-Opens an persistent cursor to an index tree without initializing the
-cursor. */
-UNIV_INLINE
-dberr_t
-btr_pcur_open_with_no_init_func(
-/*============================*/
- dict_index_t* index, /*!< in: index */
- const dtuple_t* tuple, /*!< in: tuple on which search done */
- page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...;
- NOTE that if the search is made using a unique
- prefix of a record, mode should be
- PAGE_CUR_LE, not PAGE_CUR_GE, as the latter
- may end up on the previous page of the
- record! */
- ulint latch_mode,/*!< in: BTR_SEARCH_LEAF, ...;
- NOTE that if ahi_latch then we might not
- acquire a cursor page latch, but assume
- that the ahi_latch protects the record! */
- btr_pcur_t* cursor, /*!< in: memory buffer for persistent cursor */
-#ifdef BTR_CUR_HASH_ADAPT
- srw_spin_lock* ahi_latch,
- /*!< in: currently held AHI rdlock, or NULL */
-#endif /* BTR_CUR_HASH_ADAPT */
- mtr_t* mtr) /*!< in: mtr */
- MY_ATTRIBUTE((warn_unused_result));
-#ifdef BTR_CUR_HASH_ADAPT
-# define btr_pcur_open_with_no_init(ix,t,md,l,cur,ahi,m) \
- btr_pcur_open_with_no_init_func(ix,t,md,l,cur,ahi,m)
-#else /* BTR_CUR_HASH_ADAPT */
-# define btr_pcur_open_with_no_init(ix,t,md,l,cur,ahi,m) \
- btr_pcur_open_with_no_init_func(ix,t,md,l,cur,m)
-#endif /* BTR_CUR_HASH_ADAPT */
+/** Opens an persistent cursor to an index tree without initializing the
+cursor.
+@param index index
+@param tuple tuple on which search done
+@param mode PAGE_CUR_L, ...; NOTE that if the search is made using a
+ unique prefix of a record, mode should be PAGE_CUR_LE, not
+ PAGE_CUR_GE, as the latter may end up on the previous page of
+ the record!
+@param latch_mode BTR_SEARCH_LEAF, ...
+@param cursor memory buffer for persistent cursor
+@param mtr mini-transaction
+@return DB_SUCCESS on success or error code otherwise. */
+inline
+dberr_t btr_pcur_open_with_no_init(dict_index_t *index, const dtuple_t *tuple,
+ page_cur_mode_t mode, ulint latch_mode,
+ btr_pcur_t *cursor, mtr_t *mtr);
/*****************************************************************//**
Opens a persistent cursor at either end of an index. */
diff --git a/storage/innobase/include/btr0pcur.inl b/storage/innobase/include/btr0pcur.inl
index 2b573068c01..82801f4426d 100644
--- a/storage/innobase/include/btr0pcur.inl
+++ b/storage/innobase/include/btr0pcur.inl
@@ -338,63 +338,37 @@ btr_pcur_open_low(
cursor->search_mode= mode;
cursor->pos_state= BTR_PCUR_IS_POSITIONED;
cursor->trx_if_known= nullptr;
- return btr_cur_search_to_nth_level_func(index, level, tuple, mode, latch_mode,
- btr_pcur_get_btr_cur(cursor),
-#ifdef BTR_CUR_HASH_ADAPT
- nullptr,
-#endif
- mtr, autoinc);
+ return btr_cur_search_to_nth_level(index, level, tuple, mode, latch_mode,
+ btr_pcur_get_btr_cur(cursor),
+ mtr, autoinc);
}
-/**************************************************************//**
-Opens an persistent cursor to an index tree without initializing the
-cursor. */
-UNIV_INLINE
-dberr_t
-btr_pcur_open_with_no_init_func(
-/*============================*/
- dict_index_t* index, /*!< in: index */
- const dtuple_t* tuple, /*!< in: tuple on which search done */
- page_cur_mode_t mode, /*!< in: PAGE_CUR_L, ...;
- NOTE that if the search is made using a unique
- prefix of a record, mode should be
- PAGE_CUR_LE, not PAGE_CUR_GE, as the latter
- may end up on the previous page of the
- record! */
- ulint latch_mode,/*!< in: BTR_SEARCH_LEAF, ...;
- NOTE that if ahi_latch then we might not
- acquire a cursor page latch, but assume
- that the ahi_latch protects the record! */
- btr_pcur_t* cursor, /*!< in: memory buffer for persistent cursor */
-#ifdef BTR_CUR_HASH_ADAPT
- srw_spin_lock* ahi_latch,
- /*!< in: currently held AHI rdlock, or NULL */
-#endif /* BTR_CUR_HASH_ADAPT */
- mtr_t* mtr) /*!< in: mtr */
+/** Opens an persistent cursor to an index tree without initializing the
+cursor.
+@param index index
+@param tuple tuple on which search done
+@param mode PAGE_CUR_L, ...; NOTE that if the search is made using a
+ unique prefix of a record, mode should be PAGE_CUR_LE, not
+ PAGE_CUR_GE, as the latter may end up on the previous page of
+ the record!
+@param latch_mode BTR_SEARCH_LEAF, ...
+@param cursor memory buffer for persistent cursor
+@param mtr mini-transaction
+@return DB_SUCCESS on success or error code otherwise. */
+inline
+dberr_t btr_pcur_open_with_no_init(dict_index_t *index, const dtuple_t *tuple,
+ page_cur_mode_t mode, ulint latch_mode,
+ btr_pcur_t *cursor, mtr_t *mtr)
{
- btr_cur_t* btr_cursor;
- dberr_t err = DB_SUCCESS;
-
- cursor->latch_mode = BTR_LATCH_MODE_WITHOUT_INTENTION(latch_mode);
- cursor->search_mode = mode;
-
- /* Search with the tree cursor */
-
- btr_cursor = btr_pcur_get_btr_cur(cursor);
-
- err = btr_cur_search_to_nth_level_func(
- index, 0, tuple, mode, latch_mode, btr_cursor,
-#ifdef BTR_CUR_HASH_ADAPT
- ahi_latch,
-#endif /* BTR_CUR_HASH_ADAPT */
- mtr);
-
- cursor->pos_state = BTR_PCUR_IS_POSITIONED;
-
- cursor->old_stored = false;
+ cursor->latch_mode= BTR_LATCH_MODE_WITHOUT_INTENTION(latch_mode);
+ cursor->search_mode= mode;
+ cursor->pos_state= BTR_PCUR_IS_POSITIONED;
+ cursor->old_stored= false;
+ cursor->trx_if_known= nullptr;
- cursor->trx_if_known = NULL;
- return err;
+ /* Search with the tree cursor */
+ return btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
+ btr_pcur_get_btr_cur(cursor), mtr);
}
/*****************************************************************//**
diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h
index b5686602610..2b8c6c252e9 100644
--- a/storage/innobase/include/btr0sea.h
+++ b/storage/innobase/include/btr0sea.h
@@ -63,15 +63,9 @@ both have sensible values.
@param[in,out] info index search info
@param[in] tuple logical record
@param[in] mode PAGE_CUR_L, ....
-@param[in] latch_mode BTR_SEARCH_LEAF, ...;
- NOTE that only if has_search_latch is 0, we will
- have a latch set on the cursor page, otherwise
- we assume the caller uses his search latch
- to protect the record!
+@param[in] latch_mode BTR_SEARCH_LEAF, ...
@param[out] cursor tree cursor
-@param[in] ahi_latch the adaptive hash index latch being held,
- or NULL
-@param[in] mtr mini transaction
+@param[in] mtr mini-transaction
@return whether the search succeeded */
bool
btr_search_guess_on_hash(
@@ -81,7 +75,6 @@ btr_search_guess_on_hash(
ulint mode,
ulint latch_mode,
btr_cur_t* cursor,
- srw_spin_lock* ahi_latch,
mtr_t* mtr);
/** Move or delete hash entries for moved records, usually in a page split.
diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h
index 838226601f8..52fd97fef9d 100644
--- a/storage/innobase/include/trx0rec.h
+++ b/storage/innobase/include/trx0rec.h
@@ -139,30 +139,6 @@ trx_undo_update_rec_get_update(
mem_heap_t* heap, /*!< in: memory heap from which the memory
needed is allocated */
upd_t** upd); /*!< out, own: update vector */
-/*******************************************************************//**
-Builds a partial row from an update undo log record, for purge.
-It contains the columns which occur as ordering in any index of the table.
-Any missing columns are indicated by col->mtype == DATA_MISSING.
-@return pointer to remaining part of undo record */
-byte*
-trx_undo_rec_get_partial_row(
-/*=========================*/
- const byte* ptr, /*!< in: remaining part in update undo log
- record of a suitable type, at the start of
- the stored index columns;
- NOTE that this copy of the undo log record must
- be preserved as long as the partial row is
- used, as we do NOT copy the data in the
- record! */
- dict_index_t* index, /*!< in: clustered index */
- const upd_t* update, /*!< in: updated columns */
- dtuple_t** row, /*!< out, own: partial row */
- ibool ignore_prefix, /*!< in: flag to indicate if we
- expect blob prefixes in undo. Used
- only in the assertion. */
- mem_heap_t* heap) /*!< in: memory heap from which the memory
- needed is allocated */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Report a RENAME TABLE operation.
@param[in,out] trx transaction
@param[in] table table that is being renamed
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 05b30dd5865..2c072d03d1b 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -1140,7 +1140,7 @@ row_ins_foreign_check_on_constraint(
tmp_heap);
err = btr_pcur_open_with_no_init(clust_index, ref,
PAGE_CUR_LE, BTR_SEARCH_LEAF,
- cascade->pcur, 0, mtr);
+ cascade->pcur, mtr);
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
goto nonstandard_exit_func;
}
@@ -2888,7 +2888,7 @@ row_ins_sec_index_entry_low(
err = btr_cur_search_to_nth_level(
index, 0, entry, PAGE_CUR_RTREE_INSERT,
search_mode,
- &cursor, 0, &mtr);
+ &cursor, &mtr);
if (err == DB_SUCCESS && search_mode == BTR_MODIFY_LEAF
&& rtr_info.mbr_adj) {
@@ -2907,7 +2907,7 @@ row_ins_sec_index_entry_low(
err = btr_cur_search_to_nth_level(
index, 0, entry, PAGE_CUR_RTREE_INSERT,
search_mode,
- &cursor, 0, &mtr);
+ &cursor, &mtr);
}
DBUG_EXECUTE_IF(
@@ -2922,7 +2922,7 @@ row_ins_sec_index_entry_low(
err = btr_cur_search_to_nth_level(
index, 0, entry, PAGE_CUR_LE,
search_mode,
- &cursor, 0, &mtr);
+ &cursor, &mtr);
}
if (err != DB_SUCCESS) {
@@ -3002,7 +3002,7 @@ row_ins_sec_index_entry_low(
index, 0, entry, PAGE_CUR_LE,
(search_mode
& ~(BTR_INSERT | BTR_IGNORE_SEC_UNIQUE)),
- &cursor, 0, &mtr);
+ &cursor, &mtr);
if (err != DB_SUCCESS) {
goto func_exit;
}
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 15835ff4afd..ccfcac63fdb 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -3081,7 +3081,7 @@ row_log_apply_op_low(
has_index_lock
? BTR_MODIFY_TREE
: BTR_MODIFY_LEAF,
- &cursor, 0, &mtr);
+ &cursor, &mtr);
if (UNIV_UNLIKELY(*error != DB_SUCCESS)) {
goto func_exit;
}
@@ -3133,7 +3133,7 @@ row_log_apply_op_low(
index->set_modified(mtr);
*error = btr_cur_search_to_nth_level(
index, 0, entry, PAGE_CUR_LE,
- BTR_MODIFY_TREE, &cursor, 0, &mtr);
+ BTR_MODIFY_TREE, &cursor, &mtr);
if (UNIV_UNLIKELY(*error != DB_SUCCESS)) {
goto func_exit;
}
@@ -3237,7 +3237,7 @@ insert_the_rec:
index->set_modified(mtr);
*error = btr_cur_search_to_nth_level(
index, 0, entry, PAGE_CUR_LE,
- BTR_MODIFY_TREE, &cursor, 0, &mtr);
+ BTR_MODIFY_TREE, &cursor, &mtr);
if (*error != DB_SUCCESS) {
break;
}
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index e3f975518a5..1b6d23660bb 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -160,7 +160,7 @@ public:
error = btr_cur_search_to_nth_level(
m_index, 0, dtuple, PAGE_CUR_RTREE_INSERT,
- BTR_MODIFY_LEAF, &ins_cur, 0, &mtr);
+ BTR_MODIFY_LEAF, &ins_cur, &mtr);
/* It need to update MBR in parent entry,
so change search mode to BTR_MODIFY_TREE */
@@ -175,7 +175,7 @@ public:
error = btr_cur_search_to_nth_level(
m_index, 0, dtuple,
PAGE_CUR_RTREE_INSERT,
- BTR_MODIFY_TREE, &ins_cur, 0, &mtr);
+ BTR_MODIFY_TREE, &ins_cur, &mtr);
}
if (error == DB_SUCCESS) {
@@ -201,7 +201,7 @@ public:
m_index, 0, dtuple,
PAGE_CUR_RTREE_INSERT,
BTR_MODIFY_TREE,
- &ins_cur, 0, &mtr);
+ &ins_cur, &mtr);
if (error == DB_SUCCESS) {
error = btr_cur_pessimistic_insert(
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 8bbb0a36144..e525e427c7a 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -869,6 +869,138 @@ skip_secondaries:
row_purge_upd_exist_or_extern_func(node,undo_rec)
#endif /* UNIV_DEBUG */
+/** Build a partial row from an update undo log record for purge.
+Any columns which occur as ordering in any index of the table are present.
+Any missing columns are indicated by col->mtype == DATA_MISSING.
+
+@param ptr remaining part of the undo log record
+@param index clustered index
+@param node purge node
+@return pointer to remaining part of undo record */
+static byte *row_purge_get_partial(const byte *ptr, const dict_index_t &index,
+ purge_node_t *node)
+{
+ bool first_v_col= true;
+ bool is_undo_log= true;
+
+ ut_ad(index.is_primary());
+ ut_ad(index.n_uniq == node->ref->n_fields);
+
+ node->row= dtuple_create_with_vcol(node->heap, index.table->n_cols,
+ index.table->n_v_cols);
+
+ /* Mark all columns in the row uninitialized, so that
+ we can distinguish missing fields from fields that are SQL NULL. */
+ for (ulint i= 0; i < index.table->n_cols; i++)
+ node->row->fields[i].type.mtype= DATA_MISSING;
+
+ dtuple_init_v_fld(node->row);
+
+ for (const upd_field_t *uf= node->update->fields, *const ue=
+ node->update->fields + node->update->n_fields; uf != ue; uf++)
+ {
+ if (!uf->old_v_val)
+ {
+ const dict_col_t &c= *dict_index_get_nth_col(&index, uf->field_no);
+ if (!c.is_dropped())
+ node->row->fields[c.ind]= uf->new_val;
+ }
+ }
+
+ const byte *end_ptr= ptr + mach_read_from_2(ptr);
+ ptr+= 2;
+
+ while (ptr != end_ptr)
+ {
+ dfield_t *dfield;
+ const byte *field;
+ const dict_col_t *col;
+ uint32_t len, orig_len, field_no= mach_read_next_compressed(&ptr);
+
+ if (field_no >= REC_MAX_N_FIELDS)
+ {
+ ptr= trx_undo_read_v_idx(index.table, ptr, first_v_col, &is_undo_log,
+ &field_no);
+ first_v_col= false;
+
+ ptr= trx_undo_rec_get_col_val(ptr, &field, &len, &orig_len);
+
+ if (field_no == FIL_NULL)
+ continue; /* there no longer is an index on the virtual column */
+
+ dict_v_col_t *vcol= dict_table_get_nth_v_col(index.table, field_no);
+ col =&vcol->m_col;
+ dfield= dtuple_get_nth_v_field(node->row, vcol->v_pos);
+ dict_col_copy_type(&vcol->m_col, &dfield->type);
+ }
+ else
+ {
+ ptr= trx_undo_rec_get_col_val(ptr, &field, &len, &orig_len);
+ col= dict_index_get_nth_col(&index, field_no);
+ if (col->is_dropped())
+ continue;
+ dfield= dtuple_get_nth_field(node->row, col->ind);
+ ut_ad(dfield->type.mtype == DATA_MISSING ||
+ dict_col_type_assert_equal(col, &dfield->type));
+ ut_ad(dfield->type.mtype == DATA_MISSING ||
+ dfield->len == len ||
+ (len != UNIV_SQL_NULL && len >= UNIV_EXTERN_STORAGE_FIELD));
+ dict_col_copy_type(dict_table_get_nth_col(index.table, col->ind),
+ &dfield->type);
+ }
+
+ dfield_set_data(dfield, field, len);
+
+ if (len == UNIV_SQL_NULL || len < UNIV_EXTERN_STORAGE_FIELD)
+ continue;
+
+ spatial_status_t spatial_status= static_cast<spatial_status_t>
+ ((len & SPATIAL_STATUS_MASK) >> SPATIAL_STATUS_SHIFT);
+ len&= ~SPATIAL_STATUS_MASK;
+
+ /* Keep compatible with 5.7.9 format. */
+ if (spatial_status == SPATIAL_UNKNOWN)
+ spatial_status= dict_col_get_spatial_status(col);
+
+ switch (UNIV_EXPECT(spatial_status, SPATIAL_NONE)) {
+ case SPATIAL_ONLY:
+ ut_ad(len - UNIV_EXTERN_STORAGE_FIELD == DATA_MBR_LEN);
+ dfield_set_len(dfield, len - UNIV_EXTERN_STORAGE_FIELD);
+ break;
+
+ case SPATIAL_MIXED:
+ dfield_set_len(dfield, len - UNIV_EXTERN_STORAGE_FIELD - DATA_MBR_LEN);
+ break;
+
+ default:
+ dfield_set_len(dfield, len - UNIV_EXTERN_STORAGE_FIELD);
+ break;
+ }
+
+ dfield_set_ext(dfield);
+ dfield_set_spatial_status(dfield, spatial_status);
+
+ if (!col->ord_part || spatial_status == SPATIAL_ONLY ||
+ node->rec_type == TRX_UNDO_UPD_DEL_REC)
+ continue;
+ /* If the prefix of this BLOB column is indexed, ensure that enough
+ prefix is stored in the undo log record. */
+ ut_a(dfield_get_len(dfield) >= BTR_EXTERN_FIELD_REF_SIZE);
+ ut_a(dict_table_has_atomic_blobs(index.table) ||
+ dfield_get_len(dfield) >=
+ REC_ANTELOPE_MAX_INDEX_COL_LEN + BTR_EXTERN_FIELD_REF_SIZE);
+ }
+
+ for (ulint i= 0; i < index.n_uniq; i++)
+ {
+ dfield_t &field= node->row->fields[index.fields[i].col->ind];
+ if (field.type.mtype == DATA_MISSING)
+ field= node->ref->fields[i];
+ }
+
+ return const_cast<byte*>(ptr);
+}
+
MY_ATTRIBUTE((nonnull,warn_unused_result))
/** Parses the row reference and other info in a modify undo log record.
@param[in] node row undo node
@@ -1020,10 +1152,7 @@ err_exit:
if (!(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
ut_ad(!(node->update->info_bits & REC_INFO_MIN_REC_FLAG));
- ptr = trx_undo_rec_get_partial_row(
- ptr, clust_index, node->update, &node->row,
- type == TRX_UNDO_UPD_DEL_REC,
- node->heap);
+ ptr = row_purge_get_partial(ptr, *clust_index, node);
} else if (node->update->info_bits & REC_INFO_MIN_REC_FLAG) {
node->ref = &trx_undo_metadata;
}
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index ec4d09115f6..614376d4a7a 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -1007,7 +1007,7 @@ row_sel_get_clust_rec(
dberr_t err = btr_pcur_open_with_no_init(index, plan->clust_ref,
PAGE_CUR_LE, BTR_SEARCH_LEAF,
- &plan->clust_pcur, 0, mtr);
+ &plan->clust_pcur, mtr);
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
goto err_exit;
}
@@ -1412,7 +1412,7 @@ row_sel_open_pcur(
err = btr_pcur_open_with_no_init(index, plan->tuple,
plan->mode, BTR_SEARCH_LEAF,
- &plan->pcur, nullptr, mtr);
+ &plan->pcur, mtr);
} else {
err = btr_pcur_open_at_index_side(plan->asc, index,
BTR_SEARCH_LEAF, &plan->pcur,
@@ -1562,8 +1562,7 @@ row_sel_try_search_shortcut(
const rec_t* rec = btr_pcur_get_rec(&(plan->pcur));
if (!page_rec_is_user_rec(rec) || rec_is_metadata(rec, *index)) {
-retry:
- return(SEL_RETRY);
+ return SEL_RETRY;
}
ut_ad(plan->mode == PAGE_CUR_GE);
@@ -1573,14 +1572,13 @@ retry:
fields in the user record matched to the search tuple */
if (btr_pcur_get_up_match(&(plan->pcur)) < plan->n_exact_match) {
-exhausted:
- return(SEL_EXHAUSTED);
+ return SEL_EXHAUSTED;
}
if (trx_id_t bulk_trx_id = index->table->bulk_trx_id) {
/* See row_search_mvcc() for a comment on bulk_trx_id */
if (!node->read_view->changes_visible(bulk_trx_id)) {
- goto exhausted;
+ return SEL_EXHAUSTED;
}
}
@@ -1597,18 +1595,18 @@ exhausted:
if (dict_index_is_clust(index)) {
if (!row_sel_clust_sees(rec, *index, offsets,
*node->read_view)) {
- goto retry;
+ return SEL_RETRY;
}
} else if (!srv_read_only_mode) {
trx_id_t trx_id = page_get_max_trx_id(page_align(rec));
ut_ad(trx_id);
if (!node->read_view->sees(trx_id)) {
- goto retry;
+ return SEL_RETRY;
}
}
if (rec_get_deleted_flag(rec, dict_table_is_comp(plan->table))) {
- goto exhausted;
+ return SEL_EXHAUSTED;
}
/* Fetch the columns needed in test conditions. The index
@@ -1622,7 +1620,7 @@ exhausted:
/* Test the rest of search conditions */
if (!row_sel_test_other_conds(plan)) {
- goto exhausted;
+ return SEL_EXHAUSTED;
}
ut_ad(plan->pcur.latch_mode == BTR_SEARCH_LEAF);
@@ -1632,7 +1630,7 @@ exhausted:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
- return(SEL_FOUND);
+ return SEL_FOUND;
}
#endif /* BTR_CUR_HASH_ADAPT */
@@ -3360,7 +3358,7 @@ Row_sel_get_clust_rec_for_mysql::operator()(
dberr_t err = btr_pcur_open_with_no_init(clust_index,
prebuilt->clust_ref,
PAGE_CUR_LE, BTR_SEARCH_LEAF,
- prebuilt->clust_pcur, 0, mtr);
+ prebuilt->clust_pcur, mtr);
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
return err;
}
@@ -3945,20 +3943,16 @@ row_sel_try_search_shortcut_for_mysql(
ut_ad(!prebuilt->templ_contains_blob);
ut_ad(trx->read_view.is_open());
- srw_spin_lock* ahi_latch = btr_search_sys.get_latch(*index);
- ahi_latch->rd_lock(SRW_LOCK_CALL);
if (btr_pcur_open_with_no_init(index, search_tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, pcur, ahi_latch, mtr)
+ BTR_SEARCH_LEAF, pcur, mtr)
!= DB_SUCCESS) {
- goto retry;
+ return SEL_RETRY;
}
rec = btr_pcur_get_rec(pcur);
if (!page_rec_is_user_rec(rec) || rec_is_metadata(rec, *index)) {
-retry:
- ahi_latch->rd_unlock();
- return(SEL_RETRY);
+ return SEL_RETRY;
}
/* As the cursor is now placed on a user record after a search with
@@ -3966,16 +3960,14 @@ retry:
fields in the user record matched to the search tuple */
if (btr_pcur_get_up_match(pcur) < dtuple_get_n_fields(search_tuple)) {
-exhausted:
- ahi_latch->rd_unlock();
- return(SEL_EXHAUSTED);
+ return SEL_EXHAUSTED;
}
if (trx->isolation_level == TRX_ISO_READ_UNCOMMITTED) {
} else if (trx_id_t bulk_trx_id = index->table->bulk_trx_id) {
/* See row_search_mvcc() for a comment on bulk_trx_id */
if (!trx->read_view.changes_visible(bulk_trx_id)) {
- goto exhausted;
+ return SEL_EXHAUSTED;
}
}
@@ -3986,20 +3978,19 @@ exhausted:
ULINT_UNDEFINED, heap);
if (!row_sel_clust_sees(rec, *index, *offsets, trx->read_view)) {
- goto retry;
+ return SEL_RETRY;
}
if (rec_get_deleted_flag(rec, dict_table_is_comp(index->table))) {
/* In delete-marked records, DB_TRX_ID must
always refer to an existing undo log record. */
ut_ad(row_get_rec_trx_id(rec, index, *offsets));
- goto exhausted;
+ return SEL_EXHAUSTED;
}
*out_rec = rec;
- ahi_latch->rd_unlock();
- return(SEL_FOUND);
+ return SEL_FOUND;
}
#endif /* BTR_CUR_HASH_ADAPT */
@@ -4772,8 +4763,7 @@ wait_table_again:
}
err = btr_pcur_open_with_no_init(index, search_tuple, mode,
- BTR_SEARCH_LEAF,
- pcur, 0, &mtr);
+ BTR_SEARCH_LEAF, pcur, &mtr);
if (err != DB_SUCCESS) {
page_corrupted:
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index 41e71d59675..766b7da1543 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1661,183 +1661,6 @@ trx_undo_update_rec_get_update(
return(const_cast<byte*>(ptr));
}
-/*******************************************************************//**
-Builds a partial row from an update undo log record, for purge.
-It contains the columns which occur as ordering in any index of the table.
-Any missing columns are indicated by col->mtype == DATA_MISSING.
-@return pointer to remaining part of undo record */
-byte*
-trx_undo_rec_get_partial_row(
-/*=========================*/
- const byte* ptr, /*!< in: remaining part in update undo log
- record of a suitable type, at the start of
- the stored index columns;
- NOTE that this copy of the undo log record must
- be preserved as long as the partial row is
- used, as we do NOT copy the data in the
- record! */
- dict_index_t* index, /*!< in: clustered index */
- const upd_t* update, /*!< in: updated columns */
- dtuple_t** row, /*!< out, own: partial row */
- ibool ignore_prefix, /*!< in: flag to indicate if we
- expect blob prefixes in undo. Used
- only in the assertion. */
- mem_heap_t* heap) /*!< in: memory heap from which the memory
- needed is allocated */
-{
- const byte* end_ptr;
- bool first_v_col = true;
- bool is_undo_log = true;
-
- ut_ad(index->is_primary());
-
- *row = dtuple_create_with_vcol(
- heap, dict_table_get_n_cols(index->table),
- dict_table_get_n_v_cols(index->table));
-
- /* Mark all columns in the row uninitialized, so that
- we can distinguish missing fields from fields that are SQL NULL. */
- for (ulint i = 0; i < dict_table_get_n_cols(index->table); i++) {
- dfield_get_type(dtuple_get_nth_field(*row, i))
- ->mtype = DATA_MISSING;
- }
-
- dtuple_init_v_fld(*row);
-
- for (const upd_field_t* uf = update->fields, * const ue
- = update->fields + update->n_fields;
- uf != ue; uf++) {
- if (uf->old_v_val) {
- continue;
- }
- const dict_col_t& c = *dict_index_get_nth_col(index,
- uf->field_no);
- if (!c.is_dropped()) {
- *dtuple_get_nth_field(*row, c.ind) = uf->new_val;
- }
- }
-
- end_ptr = ptr + mach_read_from_2(ptr);
- ptr += 2;
-
- while (ptr != end_ptr) {
- dfield_t* dfield;
- const byte* field;
- uint32_t field_no;
- const dict_col_t* col;
- uint32_t len, orig_len;
-
- field_no = mach_read_next_compressed(&ptr);
-
- const bool is_virtual = (field_no >= REC_MAX_N_FIELDS);
-
- if (is_virtual) {
- ptr = trx_undo_read_v_idx(
- index->table, ptr, first_v_col, &is_undo_log,
- &field_no);
- first_v_col = false;
- }
-
- ptr = trx_undo_rec_get_col_val(ptr, &field, &len, &orig_len);
-
- /* This column could be dropped or no longer indexed */
- if (field_no == FIL_NULL) {
- ut_ad(is_virtual);
- continue;
- }
-
- if (is_virtual) {
- dict_v_col_t* vcol = dict_table_get_nth_v_col(
- index->table, field_no);
- col = &vcol->m_col;
- dfield = dtuple_get_nth_v_field(*row, vcol->v_pos);
- dict_col_copy_type(
- &vcol->m_col,
- dfield_get_type(dfield));
- } else {
- col = dict_index_get_nth_col(index, field_no);
-
- if (col->is_dropped()) {
- continue;
- }
-
- dfield = dtuple_get_nth_field(*row, col->ind);
- ut_ad(dfield->type.mtype == DATA_MISSING
- || dict_col_type_assert_equal(col,
- &dfield->type));
- ut_ad(dfield->type.mtype == DATA_MISSING
- || dfield->len == len
- || (len != UNIV_SQL_NULL
- && len >= UNIV_EXTERN_STORAGE_FIELD));
- dict_col_copy_type(col, dfield_get_type(dfield));
- }
-
- dfield_set_data(dfield, field, len);
-
- if (len != UNIV_SQL_NULL
- && len >= UNIV_EXTERN_STORAGE_FIELD) {
- spatial_status_t spatial_status;
-
- /* Decode spatial status. */
- spatial_status = static_cast<spatial_status_t>(
- (len & SPATIAL_STATUS_MASK)
- >> SPATIAL_STATUS_SHIFT);
- len &= ~SPATIAL_STATUS_MASK;
-
- /* Keep compatible with 5.7.9 format. */
- if (spatial_status == SPATIAL_UNKNOWN) {
- spatial_status =
- dict_col_get_spatial_status(col);
- }
-
- switch (spatial_status) {
- case SPATIAL_ONLY:
- ut_ad(len - UNIV_EXTERN_STORAGE_FIELD
- == DATA_MBR_LEN);
- dfield_set_len(
- dfield,
- len - UNIV_EXTERN_STORAGE_FIELD);
- break;
-
- case SPATIAL_MIXED:
- dfield_set_len(
- dfield,
- len - UNIV_EXTERN_STORAGE_FIELD
- - DATA_MBR_LEN);
- break;
-
- case SPATIAL_NONE:
- dfield_set_len(
- dfield,
- len - UNIV_EXTERN_STORAGE_FIELD);
- break;
-
- case SPATIAL_UNKNOWN:
- ut_ad(0);
- break;
- }
-
- dfield_set_ext(dfield);
- dfield_set_spatial_status(dfield, spatial_status);
-
- /* If the prefix of this column is indexed,
- ensure that enough prefix is stored in the
- undo log record. */
- if (!ignore_prefix && col->ord_part
- && spatial_status != SPATIAL_ONLY) {
- ut_a(dfield_get_len(dfield)
- >= BTR_EXTERN_FIELD_REF_SIZE);
- ut_a(dict_table_has_atomic_blobs(index->table)
- || dfield_get_len(dfield)
- >= REC_ANTELOPE_MAX_INDEX_COL_LEN
- + BTR_EXTERN_FIELD_REF_SIZE);
- }
- }
- }
-
- return(const_cast<byte*>(ptr));
-}
-
/** Report a RENAME TABLE operation.
@param[in,out] trx transaction
@param[in] table table that is being renamed
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 3b19d213d5a..111f8fe5f3a 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -548,8 +548,10 @@ void trx_disconnect_prepared(trx_t *trx)
ut_ad(trx->mysql_thd);
ut_ad(!trx->mysql_log_file_name);
trx->read_view.close();
+ trx_sys.trx_list.freeze();
trx->is_recovered= true;
trx->mysql_thd= NULL;
+ trx_sys.trx_list.unfreeze();
/* todo/fixme: suggest to do it at innodb prepare */
trx->will_lock= false;
trx_sys.rw_trx_hash.put_pins(trx);
diff --git a/storage/maria/aria_ftdump.c b/storage/maria/aria_ftdump.c
index 8526f5fa74a..677d0221529 100644
--- a/storage/maria/aria_ftdump.c
+++ b/storage/maria/aria_ftdump.c
@@ -120,11 +120,7 @@ int main(int argc,char *argv[])
if (subkeys.i >= 0)
weight= subkeys.f;
-#ifdef HAVE_SNPRINTF
snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey_buff+1);
-#else
- sprintf(buf,"%.*s",(int) keylen,info->lastkey_buff+1);
-#endif
my_casedn_str(default_charset_info,buf);
total++;
lengths[keylen]++;
diff --git a/storage/myisam/myisam_ftdump.c b/storage/myisam/myisam_ftdump.c
index cc28d4a59e5..f2dc19c520a 100644
--- a/storage/myisam/myisam_ftdump.c
+++ b/storage/myisam/myisam_ftdump.c
@@ -118,11 +118,7 @@ int main(int argc,char *argv[])
if (subkeys.i >= 0)
weight= subkeys.f;
-#ifdef HAVE_SNPRINTF
snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1);
-#else
- sprintf(buf,"%.*s",(int) keylen,info->lastkey+1);
-#endif
my_casedn_str(default_charset_info,buf);
total++;
lengths[keylen]++;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result
new file mode 100644
index 00000000000..cc950ac0bd3
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29484.result
@@ -0,0 +1,39 @@
+#
+# MDEV-29484 Assertion `!trx_free || !trx->locked_connections' failed in spider_free_trx_conn on LOCK TABLES
+#
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+connection child2_1;
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+CREATE TABLE tbl_a (
+a INT
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+connection master_1;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+CREATE TABLE tbl_a (
+a INT
+) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+CREATE TABLE tbl_b (
+a INT
+) ENGINE=Spider DEFAULT CHARSET=utf8;
+LOCK TABLES tbl_a WRITE;
+LOCK TABLES tbl_b READ, tbl_a READ;
+ERROR HY000: Unable to connect to foreign data source: localhost
+disconnect master_1;
+connect master_1, localhost, root, , , $MASTER_1_MYPORT, $MASTER_1_MYSOCK;
+connection child2_1;
+DROP DATABASE auto_test_remote;
+connection master_1;
+DROP DATABASE auto_test_local;
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf
new file mode 100644
index 00000000000..05dfd8a0bce
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.cnf
@@ -0,0 +1,3 @@
+!include include/default_mysqld.cnf
+!include ../my_1_1.cnf
+!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.test
new file mode 100644
index 00000000000..b6fe3b549f2
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29484.test
@@ -0,0 +1,47 @@
+--echo #
+--echo # MDEV-29484 Assertion `!trx_free || !trx->locked_connections' failed in spider_free_trx_conn on LOCK TABLES
+--echo #
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+
+--connection child2_1
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+eval CREATE TABLE tbl_a (
+ a INT
+) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
+
+--connection master_1
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+
+eval CREATE TABLE tbl_a (
+ a INT
+) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
+
+eval CREATE TABLE tbl_b (
+ a INT
+) $MASTER_1_ENGINE $MASTER_1_CHARSET;
+
+LOCK TABLES tbl_a WRITE;
+--error 1429
+LOCK TABLES tbl_b READ, tbl_a READ;
+
+--disconnect master_1 # crash
+--source ../../t/connect_master_1.inc
+
+--connection child2_1
+DROP DATABASE auto_test_remote;
+
+--connection master_1
+DROP DATABASE auto_test_local;
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_deinit.inc
+--enable_result_log
+--enable_query_log
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index e832c2bc450..0023a5d4bbc 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -103,7 +103,6 @@ int spider_free_trx_conn(SPIDER_TRX *trx, bool trx_free)
HASH *conn_hash= &trx->trx_conn_hash;
DBUG_ENTER("spider_free_trx_conn");
- DBUG_ASSERT(!trx_free || !trx->locked_connections);
/* Clear the connection queues in any case. */
while ((conn= (SPIDER_CONN *) my_hash_element(conn_hash, loop_count)))
@@ -114,11 +113,16 @@ int spider_free_trx_conn(SPIDER_TRX *trx, bool trx_free)
if (trx_free || spider_param_conn_recycle_mode(trx->thd) != 2)
{
- /* Free connections only when no connection is locked. */
- if (!trx->locked_connections)
+ loop_count= 0;
+ while ((conn= (SPIDER_CONN *) my_hash_element(&trx->trx_conn_hash,
+ loop_count)))
{
- loop_count= 0;
- while ((conn= (SPIDER_CONN *) my_hash_element(conn_hash, loop_count)))
+ if (conn->table_lock)
+ {
+ DBUG_ASSERT(!trx_free);
+ loop_count++;
+ }
+ else
{
spider_free_conn_from_trx(trx, conn, FALSE, trx_free, &loop_count);
}
diff --git a/support-files/wsrep_notify.sh b/support-files/wsrep_notify.sh
index bdbe3d12a39..87ba11342c5 100644..100755
--- a/support-files/wsrep_notify.sh
+++ b/support-files/wsrep_notify.sh
@@ -4,12 +4,31 @@
# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status'
# and fill them on every membership or node status change.
#
-# Edit parameters below to specify the address and login to server.
-
+# Edit parameters below to specify the address and login to server:
+#
USER=root
PSWD=rootpass
+#
+# If these parameters are not set, then the values
+# passed by the server are taken:
+#
HOST=127.0.0.1
PORT=3306
+#
+# Edit parameters below to specify SSL parameters:
+#
+ssl_key=
+ssl_cert=
+ssl_ca=
+ssl_capath=
+ssl_cipher=
+ssl_crl=
+ssl_crlpath=
+ssl_verify_server_cert=0
+#
+# Client executable path:
+#
+CLIENT="mysql"
SCHEMA="wsrep"
MEMB_TABLE="$SCHEMA.membership"
@@ -32,8 +51,6 @@ CREATE TABLE $STATUS_TABLE (
prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY;
BEGIN;
-DELETE FROM $MEMB_TABLE;
-DELETE FROM $STATUS_TABLE;
"
END="COMMIT;"
@@ -43,7 +60,7 @@ configuration_change()
local idx=0
- for NODE in $(echo $MEMBERS | sed s/,/\ /g)
+ for NODE in $(echo "$MEMBERS" | sed s/,/\ /g)
do
echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, "
# Don't forget to properly quote string values
@@ -62,17 +79,44 @@ status_update()
echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;"
}
+trim_string()
+{
+ if [ -n "${BASH_VERSION:-}" ]; then
+ local pattern="[![:space:]${2:-}]"
+ local x="${1#*$pattern}"
+ local z=${#1}
+ x=${#x}
+ if [ $x -ne $z ]; then
+ local y="${1%$pattern*}"
+ y=${#y}
+ x=$(( z-x-1 ))
+ y=$(( y-x+1 ))
+ printf '%s' "${1:$x:$y}"
+ else
+ printf ''
+ fi
+ else
+ local pattern="[[:space:]${2:-}]"
+ echo "$1" | sed -E "s/^$pattern+|$pattern+\$//g"
+ fi
+}
+
COM=status_update # not a configuration change by default
-while [ $# -gt 0 ]
-do
+STATUS=""
+CLUSTER_UUID=""
+PRIMARY="0"
+INDEX=""
+MEMBERS=""
+
+while [ $# -gt 0 ]; do
case $1 in
--status)
- STATUS=$2
+ STATUS=$(trim_string "$2")
shift
;;
--uuid)
- CLUSTER_UUID=$2
+ CLUSTER_UUID=$(trim_string "$2")
shift
;;
--primary)
@@ -81,22 +125,71 @@ do
shift
;;
--index)
- INDEX=$2
+ INDEX=$(trim_string "$2")
shift
;;
--members)
- MEMBERS=$2
+ MEMBERS=$(trim_string "$2")
shift
;;
esac
shift
done
-# Undefined means node is shutting down
-if [ "$STATUS" != "Undefined" ]
+USER=$(trim_string "$USER")
+PSWD=$(trim_string "$PSWD")
+
+HOST=$(trim_string "$HOST")
+PORT=$(trim_string "$PORT")
+
+case "$HOST" in
+\[*)
+ HOST="${HOST##\[}"
+ HOST=$(trim_string "${HOST%%\]}")
+ ;;
+esac
+
+if [ -z "$HOST" ]; then
+ HOST="${NOTIFY_HOST:-}"
+fi
+if [ -z "$PORT" ]; then
+ PORT="${NOTIFY_PORT:-}"
+fi
+
+ssl_key=$(trim_string "$ssl_key");
+ssl_cert=$(trim_string "$ssl_cert");
+ssl_ca=$(trim_string "$ssl_ca");
+ssl_capath=$(trim_string "$ssl_capath");
+ssl_cipher=$(trim_string "$ssl_cipher");
+ssl_crl=$(trim_string "$ssl_crl");
+ssl_crlpath=$(trim_string "$ssl_crlpath");
+ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
+
+SSL_PARAM=""
+
+if [ -n "$ssl_key" -o -n "$ssl_cert" -o \
+ -n "$ssl_ca" -o -n "$ssl_capath" -o \
+ -n "$ssl_cipher" ]
then
- $COM | mysql -B -u$USER -p$PSWD -h$HOST -P$PORT
+ SSL_PARAM=' --ssl'
+ [ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
+ [ -n "$ssl_cert" ] && SSL_PARAM="$SSL_PARAM --ssl-cert='$ssl_cert'"
+ [ -n "$ssl_ca" ] && SSL_PARAM="$SSL_PARAM --ssl-ca='$ssl_ca'"
+ [ -n "$ssl_capath" ] && SSL_PARAM="$SSL_PARAM --ssl-capath='$ssl_capath'"
+ [ -n "$ssl_cipher" ] && SSL_PARAM="$SSL_PARAM --ssl-cipher='$ssl_cipher'"
+ [ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
+ [ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
+ if [ -n "$ssl_verify_server_cert" ]; then
+ if [ $ssl_verify_server_cert -ne 0 ]; then
+ SSL_PARAM+=' --ssl-verify-server-cert'
+ fi
+ fi
+fi
+
+# Undefined means node is shutting down
+if [ "$STATUS" != 'Undefined' ]; then
+ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
+ "-h'$HOST'" "-P$PORT"$SSL_PARAM
fi
exit 0
-#