diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7357b062d1c..10859236f7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -264,8 +264,6 @@ IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN AND
   MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
 ENDIF()
 
-INCLUDE(wsrep)
-
 OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_RETURN()/DBUG_PRINT()" ON)
 IF(WITH_DBUG_TRACE)
   FOREACH(LANG C CXX)
@@ -276,7 +274,12 @@ ENDIF()
 # Always enable debug sync for debug builds.
 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
- 
+
+IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10")
+  # Enable extra checks when using a recent enough version of GNU libstdc++
+  SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -D_GLIBCXX_ASSERTIONS")
+ENDIF()
+
 OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
 IF (ENABLE_GCOV)
   MY_CHECK_AND_SET_COMPILER_FLAG("-DHAVE_gcov -fprofile-arcs -ftest-coverage -lgcov" DEBUG)
@@ -337,6 +340,8 @@ ELSEIF(TRASH_FREED_MEMORY MATCHES "AUTO" AND NOT WIN32 AND NOT WITH_VALGRIND AND
   SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTRASH_FREED_MEMORY")
 ENDIF()
 
+INCLUDE(wsrep)
+
 # Set commonly used variables
 IF(WIN32)
   SET(DEFAULT_MYSQL_HOME "C:/Program Files/MariaDB ${MYSQL_BASE_VERSION}")
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index b0009029bb2..a0821475d26 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -3024,7 +3024,8 @@ int main(int argc, char** argv)
   {
     if (!opt_version)
     {
-      usage();
+      error("Please provide the log file(s). Run with '--help' for usage "
+            "instructions.");
       retval= ERROR_STOP;
     }
     goto err;
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 7d260ee18cb..f275009c1e2 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -3068,8 +3068,9 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
   }
   else
     dynstr_set_checked(&select_field_names, "");
-  insert_option= ((delayed && opt_ignore) ? " DELAYED IGNORE " :
-                  delayed ? " DELAYED " : opt_ignore ? " IGNORE " : "");
+
+  insert_option= ((delayed && opt_ignore) ? "DELAYED IGNORE " :
+                  delayed ? "DELAYED " : opt_ignore ? "IGNORE " : "");
 
   verbose_msg("-- Retrieving table structure for table %s...\n", table);
 
diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake
index 752f882d4a8..31880d21328 100644
--- a/cmake/pcre.cmake
+++ b/cmake/pcre.cmake
@@ -49,16 +49,16 @@ MACRO(BUNDLE_PCRE2)
     SET(pcre2_flags${v} "${pcre2_flags${v}} -std=c99 ")
     IF(MSVC)
       # Suppress a warning
-      STRING(APPEND pcre2_flags${v} " /wd4244 " )
+      STRING(APPEND pcre2_flags${v} " /wd4244 /wd4267 " )
       # Disable asan support
-      STRING(REPLACE "-fsanitize=address" "" pcre2_flags${v} "${CMAKE_C_FLAGS${v}}")
+      STRING(REPLACE "-fsanitize=address" "" pcre2_flags${v} "${pcre2_flags${v}}")
     ENDIF()
   ENDFOREACH()
   ExternalProject_Add(
     pcre2
     PREFIX   "${dir}"
-    URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.zip"
-    URL_MD5 fe90992fbfb03f854bd9f344074f49eb
+    URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.43/pcre2-10.43.zip"
+    URL_MD5 b58f050f2fdd6f2ca5774a2975377a85
     INSTALL_COMMAND ""
     CMAKE_ARGS
       "-DCMAKE_WARN_DEPRECATED=FALSE"
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
index 9e085189e4f..ee47eb427d9 100644
--- a/cmake/zlib.cmake
+++ b/cmake/zlib.cmake
@@ -37,10 +37,14 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
   IF(WITH_ZLIB STREQUAL "bundled")
     MYSQL_USE_BUNDLED_ZLIB()
   ELSE()
-    INCLUDE(FindZLIB)
+    FIND_PACKAGE(PkgConfig QUIET)
+    IF(PKG_CONFIG_FOUND AND (COMMAND PKG_GET_VARIABLE) AND (NOT WIN32))
+      PKG_GET_VARIABLE(ZLIB_ROOT zlib prefix)
+    ENDIF()
+    FIND_PACKAGE(ZLIB)
     IF(ZLIB_FOUND)
      INCLUDE(CheckFunctionExists)
-      SET(CMAKE_REQUIRED_LIBRARIES z)
+      SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
       CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32)
       CHECK_FUNCTION_EXISTS(compressBound HAVE_COMPRESSBOUND)
       CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND)
diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc
index 8c9cdb54363..1e853d186b1 100644
--- a/mysql-test/include/have_innodb.inc
+++ b/mysql-test/include/have_innodb.inc
@@ -3,6 +3,11 @@
 # will be skipped unless innodb is enabled
 #
 --disable_query_log
+if (`select version() like '%debug%'`)
+{
+SET STATEMENT sql_log_bin=0 FOR
+call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
+}
 if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like 'MSAN%'`)
 {
 SET STATEMENT sql_log_bin=0 FOR
diff --git a/mysql-test/main/func_hybrid_type.result b/mysql-test/main/func_hybrid_type.result
index d2303e6c395..b4057effbaa 100644
--- a/mysql-test/main/func_hybrid_type.result
+++ b/mysql-test/main/func_hybrid_type.result
@@ -4313,5 +4313,30 @@ ERROR HY000: Illegal parameter data types bigint unsigned and row for operation
 SELECT @@max_allowed_packet=ROW(1,1);
 ERROR HY000: Illegal parameter data types bigint unsigned and row for operation '='
 #
+# MDEV-21034 GREATEST() and LEAST() malfunction for NULL
+#
+SELECT 5 AS c1 FROM dual WHERE GREATEST(1, NULL);
+c1
+SELECT 5 AS c1 FROM dual WHERE LEAST(1, NULL);
+c1
+CREATE TABLE t0 (c0 INT);
+INSERT INTO t0 VALUES (1);
+SELECT * FROM t0 WHERE GREATEST(c0, NULL);
+c0
+SELECT * FROM t0 WHERE LEAST(c0, NULL);
+c0
+DROP TABLE t0;
+SELECT 5 AS c1 FROM dual WHERE GREATEST(1e0, NULL);
+c1
+SELECT 5 AS c1 FROM dual WHERE LEAST(1e0, NULL);
+c1
+CREATE TABLE t0 (c0 DOUBLE);
+INSERT INTO t0 VALUES (1);
+SELECT * FROM t0 WHERE GREATEST(c0, NULL);
+c0
+SELECT * FROM t0 WHERE LEAST(c0, NULL);
+c0
+DROP TABLE t0;
+#
 # End of 10.5 tests
 #
diff --git a/mysql-test/main/func_hybrid_type.test b/mysql-test/main/func_hybrid_type.test
index 508cdcfb668..2ebfb3cfdf1 100644
--- a/mysql-test/main/func_hybrid_type.test
+++ b/mysql-test/main/func_hybrid_type.test
@@ -1115,6 +1115,29 @@ SELECT 0x20+ROW(1,1);
 --error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
 SELECT @@max_allowed_packet=ROW(1,1);
 
+--echo #
+--echo # MDEV-21034 GREATEST() and LEAST() malfunction for NULL
+--echo #
+
+SELECT 5 AS c1 FROM dual WHERE GREATEST(1, NULL);
+SELECT 5 AS c1 FROM dual WHERE LEAST(1, NULL);
+
+CREATE TABLE t0 (c0 INT);
+INSERT INTO t0 VALUES (1);
+SELECT * FROM t0 WHERE GREATEST(c0, NULL);
+SELECT * FROM t0 WHERE LEAST(c0, NULL);
+DROP TABLE t0;
+
+SELECT 5 AS c1 FROM dual WHERE GREATEST(1e0, NULL);
+SELECT 5 AS c1 FROM dual WHERE LEAST(1e0, NULL);
+
+CREATE TABLE t0 (c0 DOUBLE);
+INSERT INTO t0 VALUES (1);
+SELECT * FROM t0 WHERE GREATEST(c0, NULL);
+SELECT * FROM t0 WHERE LEAST(c0, NULL);
+DROP TABLE t0;
+
+
 --echo #
 --echo # End of 10.5 tests
 --echo #
diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result
index 98d5fdcf3d0..4296a983d71 100644
--- a/mysql-test/main/func_math.result
+++ b/mysql-test/main/func_math.result
@@ -3617,5 +3617,20 @@ SELECT CRC32(ExtractValue('<a><b/></a>', '/a/b')) AS f;
 f
 0
 #
+# MDEV-33534 UBSAN: Negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_double_round from sql/item_func.cc|
+#
+SELECT TRUNCATE(EXP(-1.e-2),-1.e+30) AS c1;
+c1
+0
+SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) AS c1;
+c1
+0
+SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
+c1
+0
+SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
+c1
+NULL
+#
 # End of 10.5 tests
 #
diff --git a/mysql-test/main/func_math.test b/mysql-test/main/func_math.test
index 171975859e3..dbeefa94d59 100644
--- a/mysql-test/main/func_math.test
+++ b/mysql-test/main/func_math.test
@@ -1929,6 +1929,16 @@ DROP TABLE t2, t1;
 SELECT CRC32(ExtractValue('<a><b/></a>', '/a/b')) AS f;
 
 
+--echo #
+--echo # MDEV-33534 UBSAN: Negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_double_round from sql/item_func.cc|
+--echo #
+
+SELECT TRUNCATE(EXP(-1.e-2),-1.e+30) AS c1;
+SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) AS c1;
+SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
+SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
+
+
 --echo #
 --echo # End of 10.5 tests
 --echo #
diff --git a/mysql-test/main/func_regexp.result b/mysql-test/main/func_regexp.result
index e0a4702c095..8e32732e12d 100644
--- a/mysql-test/main/func_regexp.result
+++ b/mysql-test/main/func_regexp.result
@@ -178,4 +178,18 @@ select 'foo' regexp x from t1 order by x desc;
 0
 1
 drop table t1;
+#
+# MDEV-21076 NOT NULL and UNIQUE constraints cause SUM() to yield an incorrect result
+#
+CREATE TABLE t0(c0 INT NOT NULL, c1 CHAR UNIQUE);
+INSERT INTO t0 VALUES (0, 1);
+INSERT INTO t0 VALUES (0, '');
+SELECT (c1 RLIKE c1), (c0 IS NULL) FROM t0;
+(c1 RLIKE c1)	(c0 IS NULL)
+1	0
+1	0
+SELECT SUM(a.t) FROM (SELECT (c1 RLIKE c1) = (c0 IS NULL) as t FROM t0) as a;
+SUM(a.t)
+0
+DROP TABLE t0;
 # End of 10.5 tests
diff --git a/mysql-test/main/func_regexp.test b/mysql-test/main/func_regexp.test
index b9e2ef197d6..48a273f6979 100644
--- a/mysql-test/main/func_regexp.test
+++ b/mysql-test/main/func_regexp.test
@@ -121,4 +121,16 @@ select 'foo' regexp x from t1 order by x asc;
 select 'foo' regexp x from t1 order by x desc;
 drop table t1;
 
+--echo #
+--echo # MDEV-21076 NOT NULL and UNIQUE constraints cause SUM() to yield an incorrect result
+--echo #
+
+CREATE TABLE t0(c0 INT NOT NULL, c1 CHAR UNIQUE);
+INSERT INTO t0 VALUES (0, 1);
+INSERT INTO t0 VALUES (0, '');
+SELECT (c1 RLIKE c1), (c0 IS NULL) FROM t0;
+SELECT SUM(a.t) FROM (SELECT (c1 RLIKE c1) = (c0 IS NULL) as t FROM t0) as a;
+DROP TABLE t0;
+
+
 --echo # End of 10.5 tests
diff --git a/mysql-test/main/mysqldump-max.result b/mysql-test/main/mysqldump-max.result
index eb2cf2aec08..4a53a5f3328 100644
--- a/mysql-test/main/mysqldump-max.result
+++ b/mysql-test/main/mysqldump-max.result
@@ -102,7 +102,7 @@ CREATE TABLE `t1` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT  DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t2`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -114,7 +114,7 @@ CREATE TABLE `t2` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT  DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t3`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -126,7 +126,7 @@ CREATE TABLE `t3` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
-INSERT  DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t4`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -138,7 +138,7 @@ CREATE TABLE `t4` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
-INSERT  DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t5`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -150,7 +150,7 @@ CREATE TABLE `t5` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
-INSERT  DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t6`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -162,7 +162,7 @@ CREATE TABLE `t6` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t6` DISABLE KEYS */;
-INSERT  IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t6` ENABLE KEYS */;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 
@@ -199,7 +199,7 @@ CREATE TABLE `t1` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT  DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t2`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -211,7 +211,7 @@ CREATE TABLE `t2` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT  DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t3`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -223,7 +223,7 @@ CREATE TABLE `t3` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
-INSERT  DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t4`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -235,7 +235,7 @@ CREATE TABLE `t4` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
-INSERT  DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t5`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
@@ -247,7 +247,7 @@ CREATE TABLE `t5` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
-INSERT  DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
 /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
 DROP TABLE IF EXISTS `t6`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result
index 12b4c763f5d..0a3048a7116 100644
--- a/mysql-test/main/mysqldump-system.result
+++ b/mysql-test/main/mysqldump-system.result
@@ -368,31 +368,31 @@ USE mysql;
 
 LOCK TABLES `column_stats` WRITE;
 /*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
-INSERT  IGNORE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0������������������������������������������������������������������������������������������������������������������������������');
+INSERT IGNORE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0������������������������������������������������������������������������������������������������������������������������������');
 /*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `index_stats` WRITE;
 /*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
-INSERT  IGNORE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500);
+INSERT IGNORE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500);
 /*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `table_stats` WRITE;
 /*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
-INSERT  IGNORE INTO `table_stats` VALUES ('mysql','tz',393);
+INSERT IGNORE INTO `table_stats` VALUES ('mysql','tz',393);
 /*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `innodb_index_stats` WRITE;
 /*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
-INSERT  IGNORE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
+INSERT IGNORE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
 /*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `innodb_table_stats` WRITE;
 /*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
-INSERT  IGNORE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0);
+INSERT IGNORE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0);
 /*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
 UNLOCK TABLES;
 
@@ -400,31 +400,31 @@ USE mysql;
 
 LOCK TABLES `time_zone` WRITE;
 /*!40000 ALTER TABLE `time_zone` DISABLE KEYS */;
-INSERT  IGNORE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N');
+INSERT IGNORE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N');
 /*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `time_zone_name` WRITE;
 /*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
-INSERT  IGNORE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2);
+INSERT IGNORE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2);
 /*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `time_zone_leap_second` WRITE;
 /*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
-INSERT  IGNORE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22);
+INSERT IGNORE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22);
 /*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `time_zone_transition` WRITE;
 /*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */;
-INSERT  IGNORE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1);
+INSERT IGNORE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1);
 /*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
 UNLOCK TABLES;
 
 LOCK TABLES `time_zone_transition_type` WRITE;
 /*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */;
-INSERT  IGNORE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST');
+INSERT IGNORE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST');
 /*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
 UNLOCK TABLES;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result
index f7939a54a05..39ef6a2ce47 100644
--- a/mysql-test/main/mysqldump.result
+++ b/mysql-test/main/mysqldump.result
@@ -734,7 +734,7 @@ CREATE TABLE `t1` (
 
 LOCK TABLES `t1` WRITE;
 /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT  IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
+INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
 UNLOCK TABLES;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -767,7 +767,7 @@ CREATE TABLE `t1` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT  DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
+INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 
@@ -5558,7 +5558,7 @@ CREATE TABLE `nonunique_table_name` (
   UNIQUE KEY `i1` (`i1`)
 ) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
-INSERT  DELAYED INTO `nonunique_table_name` VALUES (1),(2);
+INSERT DELAYED INTO `nonunique_table_name` VALUES (1),(2);
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `nonunique_table_view_name` (
@@ -5576,7 +5576,7 @@ CREATE TABLE `basetable` (
   `id` smallint(6) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
-INSERT  DELAYED INTO `basetable` VALUES (5),(6);
+INSERT DELAYED INTO `basetable` VALUES (5),(6);
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `nonunique_table_name` (
diff --git a/mysql-test/suite/galera/t/MDEV-26597.test b/mysql-test/suite/galera/t/MDEV-26597.test
index 783a52cad50..465f1130443 100644
--- a/mysql-test/suite/galera/t/MDEV-26597.test
+++ b/mysql-test/suite/galera/t/MDEV-26597.test
@@ -18,7 +18,7 @@ SHOW WARNINGS;
 SET SESSION wsrep_sync_wait = 0;
 --source include/kill_galera.inc
 
---let $start_mysqld_params = ""
+--let $start_mysqld_params =
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
 --source include/start_mysqld.inc
 
diff --git a/mysql-test/suite/galera/t/MDEV-29142.test b/mysql-test/suite/galera/t/MDEV-29142.test
index 7e9776b005b..f7a8b329089 100644
--- a/mysql-test/suite/galera/t/MDEV-29142.test
+++ b/mysql-test/suite/galera/t/MDEV-29142.test
@@ -50,12 +50,12 @@ SET SESSION wsrep_sync_wait = 0;
 --source include/kill_galera.inc
 
 --remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
---let $start_mysqld_params = "--wsrep-new-cluster"
+--let $start_mysqld_params =--wsrep-new-cluster
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --source include/start_mysqld.inc
 
 --connection node_2
---let $start_mysqld_params = ""
+--let $start_mysqld_params =
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
 --source include/start_mysqld.inc
 
diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
index 94ea008cb16..cfa5f8bcead 100644
--- a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
+++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test
@@ -30,7 +30,7 @@
 
 --echo Starting server ...
 --let $restart_noprint=2
---let $start_mysqld_params="--wsrep-new-cluster"
+--let $start_mysqld_params=--wsrep-new-cluster
 --source include/start_mysqld.inc
 --source include/wait_until_ready.inc
 
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index ffed5432097..f71f726c4f9 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -19,5 +19,4 @@ galera_ipv6_mariabackup_section : temporarily disabled at the request of Codersh
 # Opensuse/suse/rocky9/rocky84/rhel9/rhel8-ppc64le .. - all same IPv6 isn't configured right or skipping or galera
 galera_ipv6_rsync : Can't connect to server on '::1' (115)
 galera_ipv6_rsync_section : Can't connect to server on '::1' (115)
-MDEV-29171 : MDEV-33842 galera_3nodes.MDEV-29171 fails on shutdown_server
 GCF-354 : MDEV-25614 Galera test failure on GCF-354
diff --git a/mysql-test/suite/galera_3nodes/r/MDEV-29171.result b/mysql-test/suite/galera_3nodes/r/MDEV-29171.result
index 371ce006dd3..55513ff53af 100644
--- a/mysql-test/suite/galera_3nodes/r/MDEV-29171.result
+++ b/mysql-test/suite/galera_3nodes/r/MDEV-29171.result
@@ -19,20 +19,40 @@ connection node_2;
 connection node_1;
 connection node_1;
 # restart: --wsrep_new_cluster --wsrep_gtid_domain_id=200
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE
+Primary
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE
+Synced
 show variables like 'wsrep_gtid_domain_id';
 Variable_name	Value
 wsrep_gtid_domain_id	200
 connection node_2;
 # restart
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE
+Primary
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE
+Synced
 show variables like 'wsrep_gtid_domain_id';
 Variable_name	Value
 wsrep_gtid_domain_id	200
+connection node_1;
 connection node_3;
 # restart: --wsrep_sst_donor=node2
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+VARIABLE_VALUE
+Primary
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+VARIABLE_VALUE
+Synced
 show variables like 'wsrep_gtid_domain_id';
 Variable_name	Value
 wsrep_gtid_domain_id	200
 connection node_1;
+connection node_1;
 set global wsrep_gtid_domain_id=100;
 connection node_2;
 set global wsrep_gtid_domain_id=100;
diff --git a/mysql-test/suite/galera_3nodes/t/MDEV-29171.test b/mysql-test/suite/galera_3nodes/t/MDEV-29171.test
index bfb7abf9a8b..1ce33bee974 100644
--- a/mysql-test/suite/galera_3nodes/t/MDEV-29171.test
+++ b/mysql-test/suite/galera_3nodes/t/MDEV-29171.test
@@ -50,6 +50,16 @@ select @@wsrep_gtid_domain_id,@@wsrep_node_name;
 --connection node_1
 --let $restart_parameters = --wsrep_new_cluster --wsrep_gtid_domain_id=200
 --source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
 show variables like 'wsrep_gtid_domain_id';
 
 #
@@ -59,8 +69,21 @@ show variables like 'wsrep_gtid_domain_id';
 --let $restart_parameters =
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
 --source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
 show variables like 'wsrep_gtid_domain_id';
 
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
 
 #
 # Restart node_3, select node_2 as donor
@@ -70,9 +93,23 @@ show variables like 'wsrep_gtid_domain_id';
 --let $restart_parameters = --wsrep_sst_donor="node2"
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
 --source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'
+--source include/wait_condition.inc
+
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+
 # Expect domain id 200
 show variables like 'wsrep_gtid_domain_id';
 
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
 
 #
 # Cleanup
diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_consistency.cnf b/mysql-test/suite/galera_3nodes/t/galera_gtid_consistency.cnf
index 5bd03178d1f..c27490faf36 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_gtid_consistency.cnf
+++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_consistency.cnf
@@ -33,3 +33,6 @@ log_slave_updates=ON
 log_bin=mariadb-bin-log
 binlog-format=row
 wsrep-gtid-mode=ON
+
+[sst]
+transferfmt=@ENV.MTR_GALERA_TFMT
diff --git a/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.test b/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.test
index 5332b1a1579..f6f50fd50c9 100644
--- a/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.test
+++ b/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.test
@@ -38,12 +38,12 @@ SET SESSION wsrep_sync_wait = 0;
 --source include/kill_galera.inc
 
 --remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
---let $start_mysqld_params = "--wsrep-new-cluster"
+--let $start_mysqld_params =--wsrep-new-cluster
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --source include/start_mysqld.inc
 
 --connection node_2
---let $start_mysqld_params = ""
+--let $start_mysqld_params =
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
 --source include/start_mysqld.inc
 
diff --git a/mysql-test/suite/mariabackup/incremental_encrypted.test b/mysql-test/suite/mariabackup/incremental_encrypted.test
index d5570f20006..a2fb7e74565 100644
--- a/mysql-test/suite/mariabackup/incremental_encrypted.test
+++ b/mysql-test/suite/mariabackup/incremental_encrypted.test
@@ -7,6 +7,12 @@ if (!$EXAMPLE_KEY_MANAGEMENT_SO)
 }
 call mtr.add_suppression("InnoDB: New log files created");
 
+if (`select @@innodb_page_size=65536`)
+{
+  # this needs too much memory for 32bit
+  source include/have_64bit.inc;
+}
+
 
 let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
 let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc
index 683c4561c15..ba97d9094a9 100644
--- a/mysql-test/suite/perfschema/include/stage_setup.inc
+++ b/mysql-test/suite/perfschema/include/stage_setup.inc
@@ -121,12 +121,23 @@ begin
       where thread_id = my_thread_id
       and nesting_event_id = my_statement_id
       order by event_id asc;
-    # Ignore query cache as it may not be enabled
-    select username, event_name, nesting_event_type
-      from performance_schema.events_stages_history
-      where thread_id = my_thread_id
-      and nesting_event_id = my_statement_id and
-      event_name not like "%query cache%"
+    # 1. Ignore query cache as it may not be enabled
+    # 2. MDL wait consists of short 1 second waits (this is not configurable)
+    #    repeated until lock_wait_timeout is reached. The stage is changed
+    #    to Waiting and back every second. To have predictable result here
+    #    the query filters all sequences of X, "Waiting for MDL", X,
+    #    leaving just X.
+    with h as (
+      select event_id, username, event_name, nesting_event_type,
+        lag(event_name) over (order by event_id) = lead(event_name) over (order by event_id)
+        and event_name = "stage/sql/Waiting for stored function metadata lock" as v1,
+        lag(event_name, 2) over (order by event_id) = event_name
+        and lag(event_name, 1) over (order by event_id) = "stage/sql/Waiting for stored function metadata lock" as v2
+        from performance_schema.events_stages_history
+        where thread_id = my_thread_id
+        and nesting_event_id = my_statement_id and
+        event_name not like "%query cache%"
+      ) select username, event_name, nesting_event_type from h where v1 is not true and v2 is not true
       order by event_id asc;
   end;
   else
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
index 50f24d56e9a..788f8bdfc06 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
@@ -112,6 +112,10 @@ a
 6
 7
 *** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable
+connection server_1;
+INSERT INTO t1 VALUES (8);
+DELETE FROM t1 WHERE a=8;
+connection server_2;
 connection server_2;
 include/stop_slave.inc
 CHANGE MASTER TO master_use_gtid= no;
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 0d232f3c60c..647128a0750 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
@@ -174,6 +174,24 @@ SELECT * FROM t1 ORDER BY a;
 
 --echo *** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable
 
+# In GTID mode, the old-style replication position is also updated. But during
+# GTID connect, the old-style position is not known until receiving the fake
+# GTID list event, which contains the required position value. If we happened
+# to stop the slave above before this fake GTID list event, the test could fail
+# with duplicate key errors due to switching to non-GTID mode at a wrong
+# position too far back in the binlog.
+#
+# Work-around this by injecting an extra dummt event and syncing the slave to
+# it, ensuring the old-style position will be updated.
+#
+# This work-around could be removed after MDEV-33996 is fixed.
+--connection server_1
+INSERT INTO t1 VALUES (8);
+DELETE FROM t1 WHERE a=8;
+--save_master_pos
+--connection server_2
+--sync_with_master
+
 --connection server_2
 --source include/stop_slave.inc
 CHANGE MASTER TO master_use_gtid= no;
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 8a05979ec16..729646532a7 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2632,12 +2632,12 @@ void Item_func_round::fix_arg_hex_hybrid()
 }
 
 
-double my_double_round(double value, longlong dec, bool dec_unsigned,
+double my_double_round(double value, longlong dec_value, bool dec_unsigned,
                        bool truncate)
 {
   double tmp;
-  bool dec_negative= (dec < 0) && !dec_unsigned;
-  ulonglong abs_dec= dec_negative ? -dec : dec;
+  const Longlong_hybrid dec(dec_value, dec_unsigned);
+  const ulonglong abs_dec= dec.abs();
   /*
     tmp2 is here to avoid return the value with 80 bit precision
     This will fix that the test round(0.1,1) = round(0.1,1) is true
@@ -2652,22 +2652,24 @@ double my_double_round(double value, longlong dec, bool dec_unsigned,
   volatile double value_div_tmp= value / tmp;
   volatile double value_mul_tmp= value * tmp;
 
-  if (!dec_negative && std::isinf(tmp)) // "dec" is too large positive number
+  if (!dec.neg() && std::isinf(tmp)) // "dec" is a too large positive number
     return value;
 
-  if (dec_negative && std::isinf(tmp))
-    tmp2= 0.0;
-  else if (!dec_negative && std::isinf(value_mul_tmp))
+  if (dec.neg() && std::isinf(tmp)) // "dec" is a too small negative number
+    return 0.0;
+
+  // Handle "dec" with a reasonably small absolute value
+  if (!dec.neg() && std::isinf(value_mul_tmp))
     tmp2= value;
   else if (truncate)
   {
     if (value >= 0.0)
-      tmp2= dec < 0 ? floor(value_div_tmp) * tmp : floor(value_mul_tmp) / tmp;
+      tmp2= dec.neg() ? floor(value_div_tmp) * tmp : floor(value_mul_tmp) / tmp;
     else
-      tmp2= dec < 0 ? ceil(value_div_tmp) * tmp : ceil(value_mul_tmp) / tmp;
+      tmp2= dec.neg() ? ceil(value_div_tmp) * tmp : ceil(value_mul_tmp) / tmp;
   }
   else
-    tmp2=dec < 0 ? rint(value_div_tmp) * tmp : rint(value_mul_tmp) / tmp;
+    tmp2=dec.neg() ? rint(value_div_tmp) * tmp : rint(value_mul_tmp) / tmp;
 
   return tmp2;
 }
@@ -3016,7 +3018,7 @@ double Item_func_min_max::val_real_native()
 	value=tmp;
     }
     if ((null_value= args[i]->null_value))
-      break;
+      return 0;
   }
   return value;
 }
@@ -3037,7 +3039,7 @@ longlong Item_func_min_max::val_int_native()
 	value=tmp;
     }
     if ((null_value= args[i]->null_value))
-      break;
+      return 0;
   }
   return value;
 }
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index 3f3158e7db4..fb47f235b6f 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -276,7 +276,6 @@ void mtr_t::commit_shrink(fil_space_t &space, uint32_t size)
   ut_ad(!is_inside_ibuf());
   ut_ad(!high_level_read_only);
   ut_ad(m_modifications);
-  ut_ad(m_made_dirty);
   ut_ad(!m_memo.empty());
   ut_ad(!recv_recovery_is_on());
   ut_ad(m_log_mode == MTR_LOG_ALL);
diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index f55d78f0162..a566580dca3 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -124,7 +124,7 @@ ENDIF()
 IF (CURL_FOUND)
   INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
   MYSQL_ADD_PLUGIN(s3 ha_s3.cc ${S3_SOURCES} COMPONENT s3-engine
-    LINK_LIBRARIES ${CURL_LIBRARIES} z STORAGE_ENGINE NOT_EMBEDDED CONFIG s3.cnf)
+    LINK_LIBRARIES ${CURL_LIBRARIES} ${ZLIB_LIBRARY} STORAGE_ENGINE NOT_EMBEDDED CONFIG s3.cnf)
 ENDIF()
 
 SET(CPACK_RPM_s3-engine_PACKAGE_SUMMARY "Amazon S3 archival storage engine for MariaDB" PARENT_SCOPE)
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_30727.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_30727.result
new file mode 100644
index 00000000000..ce8ebdc3966
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_30727.result
@@ -0,0 +1,24 @@
+CREATE FUNCTION spider_direct_sql RETURNS INT SONAME 'ha_spider.so';
+SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
+ERROR HY000: Plugin 'SPIDER' is not loaded
+CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
+SELECT spider_bg_direct_sql ('SELECT * FROM s','a','srv "b"');
+ERROR HY000: Plugin 'SPIDER' is not loaded
+CREATE FUNCTION spider_copy_tables RETURNS INT SONAME 'ha_spider.so';
+SELECT spider_copy_tables ('t', '0', '0');
+ERROR HY000: Plugin 'SPIDER' is not loaded
+CREATE FUNCTION spider_flush_table_mon_cache RETURNS INT SONAME 'ha_spider.so';
+SELECT spider_flush_table_mon_cache ();
+spider_flush_table_mon_cache ()
+1
+install soname 'ha_spider';
+SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
+ERROR HY000: The foreign server name you are trying to reference does not exist. Data source error:  b
+call mtr.add_suppression(".*\\[Error\\] (mysqld|mariadbd): Can't find record in 'spider_tables'");
+SELECT spider_copy_tables ('t', '0', '0');
+ERROR HY000: Can't find record in 'spider_tables'
+SELECT spider_flush_table_mon_cache ();
+spider_flush_table_mon_cache ()
+1
+Warnings:
+Warning	1620	Plugin is busy and will be uninstalled on shutdown
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_30727.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_30727.test
new file mode 100644
index 00000000000..e1d917e7147
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_30727.test
@@ -0,0 +1,30 @@
+CREATE FUNCTION spider_direct_sql RETURNS INT SONAME 'ha_spider.so';
+--error ER_PLUGIN_IS_NOT_LOADED
+SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
+
+CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
+--error ER_PLUGIN_IS_NOT_LOADED
+SELECT spider_bg_direct_sql ('SELECT * FROM s','a','srv "b"');
+
+CREATE FUNCTION spider_copy_tables RETURNS INT SONAME 'ha_spider.so';
+--error ER_PLUGIN_IS_NOT_LOADED
+SELECT spider_copy_tables ('t', '0', '0');
+
+# spider_flush_table_mon_cache does not require spider init to function
+CREATE FUNCTION spider_flush_table_mon_cache RETURNS INT SONAME 'ha_spider.so';
+SELECT spider_flush_table_mon_cache ();
+
+# The function functions properly after the plugin is installed
+install soname 'ha_spider';
+
+--error ER_FOREIGN_SERVER_DOESNT_EXIST
+SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
+
+call mtr.add_suppression(".*\\[Error\\] (mysqld|mariadbd): Can't find record in 'spider_tables'");
+--error ER_KEY_NOT_FOUND
+SELECT spider_copy_tables ('t', '0', '0');
+
+SELECT spider_flush_table_mon_cache ();
+
+--disable_query_log
+--source ../../include/clean_up_spider.inc
diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc
index c2463ce30df..1783fe7374b 100644
--- a/storage/spider/spd_copy_tables.cc
+++ b/storage/spider/spd_copy_tables.cc
@@ -1154,12 +1154,20 @@ error:
   DBUG_RETURN(0);
 }
 
+#undef my_error
+extern "C" void my_error(unsigned int nr, unsigned long MyFlags, ...);
+
 my_bool spider_copy_tables_init_body(
   UDF_INIT *initid,
   UDF_ARGS *args,
   char *message
 ) {
   DBUG_ENTER("spider_copy_tables_init_body");
+  if (!spider_hton_ptr)
+  {
+    my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "SPIDER");
+    goto error;
+  }
   if (args->arg_count != 3 && args->arg_count != 4)
   {
     strcpy(message, "spider_copy_tables() requires 3 or 4 arguments");
diff --git a/storage/spider/spd_direct_sql.cc b/storage/spider/spd_direct_sql.cc
index de40930f117..15a414a96e1 100644
--- a/storage/spider/spd_direct_sql.cc
+++ b/storage/spider/spd_direct_sql.cc
@@ -1879,6 +1879,9 @@ error:
   DBUG_RETURN(0);
 }
 
+#undef my_error
+extern "C" void my_error(unsigned int nr, unsigned long MyFlags, ...);
+
 my_bool spider_direct_sql_init_body(
   UDF_INIT *initid,
   UDF_ARGS *args,
@@ -1887,6 +1890,11 @@ my_bool spider_direct_sql_init_body(
 ) {
   SPIDER_BG_DIRECT_SQL *bg_direct_sql;
   DBUG_ENTER("spider_direct_sql_init_body");
+  if (!spider_hton_ptr)
+  {
+    my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "SPIDER");
+    goto error;
+  }
   if (args->arg_count != 3)
   {
     strcpy(message, "spider_(bg)_direct_sql() requires 3 arguments");