summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-12-08 10:33:36 +0100
committerSergei Golubchik <serg@mariadb.org>2021-12-08 10:33:36 +0100
commitef77c05126b34b72c5b98a051739b74e93f3eaca (patch)
tree947eb192b1701a3991fc3eabc419454018e4fc97
parent60d565e66a76e42b4fb9c0c09aa0898e4a65d71d (diff)
parent186c1fa25057a465f4725ef28ce3d878af20947b (diff)
downloadmariadb-git-ef77c05126b34b72c5b98a051739b74e93f3eaca.tar.gz
Merge branch '10.6' into 10.7
-rw-r--r--cmake/Internal/CPack/CPackRPM.cmake3
-rw-r--r--cmake/build_configurations/mysql_release.cmake4
-rw-r--r--mysql-test/main/range.result24
-rw-r--r--mysql-test/main/range.test24
-rw-r--r--mysql-test/main/range_mrr_icp.result24
-rwxr-xr-xmysql-test/mariadb-test-run.pl2
-rw-r--r--mysql-test/suite/perfschema/r/digest_view.result144
-rw-r--r--mysql-test/suite/perfschema/t/digest_view.test76
-rw-r--r--sql/sql_select.cc7
-rw-r--r--storage/columnstore/CMakeLists.txt2
-rw-r--r--storage/innobase/include/log0log.h20
-rw-r--r--storage/innobase/include/log0recv.h4
-rw-r--r--storage/innobase/log/log0log.cc101
-rw-r--r--storage/innobase/log/log0recv.cc24
-rw-r--r--storage/maria/CMakeLists.txt3
-rw-r--r--storage/mroonga/vendor/groonga/CMakeLists.txt4
-rw-r--r--storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt4
-rw-r--r--unittest/mysys/thr_template.c2
18 files changed, 391 insertions, 81 deletions
diff --git a/cmake/Internal/CPack/CPackRPM.cmake b/cmake/Internal/CPack/CPackRPM.cmake
index 1ca95670cfb..cd1d3e22a52 100644
--- a/cmake/Internal/CPack/CPackRPM.cmake
+++ b/cmake/Internal/CPack/CPackRPM.cmake
@@ -23,7 +23,8 @@ macro(restore WHAT)
endmacro()
foreach (WHAT SUMMARY DESCRIPTION)
- if(NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
+ if(CPACK_RPM_PACKAGE_COMPONENT AND
+ NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
message(FATAL_ERROR "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT} is not defined")
endif()
endforeach()
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index b9728ca1ab9..531352d0338 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -105,8 +105,7 @@ ELSEIF(RPM)
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "")
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
- # not yet, SLES 12.3 doesn't provide pcre2
- #SET(WITH_PCRE system CACHE STRING "")
+ SET(WITH_PCRE system CACHE STRING "")
IF(RPM MATCHES "fedora|centos|rhel")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
ENDIF()
@@ -129,7 +128,6 @@ ELSE()
SET(WITH_JEMALLOC static CACHE STRING "")
SET(PLUGIN_AUTH_SOCKET STATIC CACHE STRING "")
SET(WITH_STRIPPED_CLIENT ON CACHE BOOL "Strip all client binaries")
- SET(WITH_PCRE bundled CACHE STRING "")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "")
ENDIF()
diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result
index d97cfb2b587..aca500bf038 100644
--- a/mysql-test/main/range.result
+++ b/mysql-test/main/range.result
@@ -3280,6 +3280,30 @@ pk i v a b
2 2 4 2 4
drop table t1, t2;
#
+# MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed
+#
+create table t1 (a int, b int, index idx(a,b));
+insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3);
+create table t2 (c int);
+insert into t2 values (5), (2), (3), (4);
+select 1 from t1 s1
+where 1 not in (select 1 from t1
+where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1));
+1
+select 1 from t1 s1
+where 1 not in (select 1 from t1
+where ((a = 1 or a = 2) and b = 1) or b = NULL);
+1
+select c from t2
+where 2 not in (select 1 from t1
+where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1));
+c
+5
+2
+3
+4
+drop table t1,t2;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test
index 6d43ad9090d..6a2e318e732 100644
--- a/mysql-test/main/range.test
+++ b/mysql-test/main/range.test
@@ -2240,6 +2240,30 @@ select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk);
drop table t1, t2;
--echo #
+--echo # MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed
+--echo #
+
+create table t1 (a int, b int, index idx(a,b));
+insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3);
+
+create table t2 (c int);
+insert into t2 values (5), (2), (3), (4);
+
+select 1 from t1 s1
+ where 1 not in (select 1 from t1
+ where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1));
+
+select 1 from t1 s1
+ where 1 not in (select 1 from t1
+ where ((a = 1 or a = 2) and b = 1) or b = NULL);
+
+select c from t2
+ where 2 not in (select 1 from t1
+ where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1));
+
+drop table t1,t2;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result
index 9fa7bd29851..eb4daf7fbc8 100644
--- a/mysql-test/main/range_mrr_icp.result
+++ b/mysql-test/main/range_mrr_icp.result
@@ -3269,6 +3269,30 @@ pk i v a b
2 2 4 2 4
drop table t1, t2;
#
+# MDEV-26553: Always FALSE/NULL disjunct on top level of WHERE is removed
+#
+create table t1 (a int, b int, index idx(a,b));
+insert into t1 values (1,1), (1,2), (2,1), (2,2), (3,3);
+create table t2 (c int);
+insert into t2 values (5), (2), (3), (4);
+select 1 from t1 s1
+where 1 not in (select 1 from t1
+where ((a = 1 or a = 2) and b = 1) or (b > 5 and b < 1));
+1
+select 1 from t1 s1
+where 1 not in (select 1 from t1
+where ((a = 1 or a = 2) and b = 1) or b = NULL);
+1
+select c from t2
+where 2 not in (select 1 from t1
+where ((a=1 or a=2) and b = 1) or (b > 5 and b < 1));
+c
+5
+2
+3
+4
+drop table t1,t2;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl
index 1a2c1cb1094..bf2d6e9be00 100755
--- a/mysql-test/mariadb-test-run.pl
+++ b/mysql-test/mariadb-test-run.pl
@@ -5084,7 +5084,7 @@ sub mysqld_start ($$) {
$mysqld->{'started_opts'}= $extra_opts;
my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
- my $rc= $oldexe eq $exe ||
+ my $rc= $oldexe eq ($exe || '') ||
sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
$opt_start_timeout, $mysqld->{'proc'}, $warn_seconds);
if (!$rc)
diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result
new file mode 100644
index 00000000000..43a8bdb1577
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/digest_view.result
@@ -0,0 +1,144 @@
+CREATE TABLE test.v1 (a int, b int);
+INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
+CREATE TABLE test.t1 (a int, b int);
+INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+EXPLAIN EXTENDED SELECT * from test.v1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1`
+EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where `test`.`v1`.`a` = 1
+EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1` where `test`.`v1`.`b` > 100
+EXPLAIN EXTENDED SELECT a, b from test.v1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`v1`.`a` AS `a`,`test`.`v1`.`b` AS `b` from `test`.`v1`
+EXPLAIN EXTENDED SELECT b, a from test.v1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE v1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`v1`.`b` AS `b`,`test`.`v1`.`a` AS `a` from `test`.`v1`
+SELECT * from test.v1;
+a b
+1 100
+2 200
+3 300
+SELECT * from test.v1 where a = 1;
+a b
+1 100
+SELECT * from test.v1 where b > 100;
+a b
+2 200
+3 300
+SELECT a, b from test.v1;
+a b
+1 100
+2 200
+3 300
+SELECT b, a from test.v1;
+b a
+100 1
+200 2
+300 3
+#
+# DIGESTS SEEN ON TABLE
+#
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+FROM performance_schema.events_statements_summary_by_digest
+ORDER BY DIGEST_TEXT;
+SCHEMA_NAME DIGEST_TEXT COUNT_STAR
+test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` 1
+test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test EXPLAIN EXTENDED SELECT `a` , `b` FROM `test` . `v1` 1
+test EXPLAIN EXTENDED SELECT `b` , `a` FROM `test` . `v1` 1
+test SELECT * FROM `test` . `v1` 1
+test SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test SELECT `a` , `b` FROM `test` . `v1` 1
+test SELECT `b` , `a` FROM `test` . `v1` 1
+test SHOW WARNINGS 5
+test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+DROP TABLE test.v1;
+CREATE VIEW test.v1 AS SELECT * FROM test.t1;
+EXPLAIN EXTENDED SELECT * from test.v1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
+EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = 1
+EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` > 100
+EXPLAIN EXTENDED SELECT a, b from test.v1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
+EXPLAIN EXTENDED SELECT b, a from test.v1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1`
+SELECT * from test.v1;
+a b
+1 100
+2 200
+3 300
+SELECT * from test.v1 where a = 1;
+a b
+1 100
+SELECT * from test.v1 where b > 100;
+a b
+2 200
+3 300
+SELECT a, b from test.v1;
+a b
+1 100
+2 200
+3 300
+SELECT b, a from test.v1;
+b a
+100 1
+200 2
+300 3
+#
+# DIGESTS SEEN ON VIEW
+#
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+FROM performance_schema.events_statements_summary_by_digest
+ORDER BY DIGEST_TEXT;
+SCHEMA_NAME DIGEST_TEXT COUNT_STAR
+test CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
+test DROP TABLE `test` . `v1` 1
+test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` 2
+test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test EXPLAIN EXTENDED SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test EXPLAIN EXTENDED SELECT `a` , `b` FROM `test` . `v1` 2
+test EXPLAIN EXTENDED SELECT `b` , `a` FROM `test` . `v1` 2
+test SELECT * FROM `test` . `v1` 2
+test SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test SELECT SCHEMA_NAME , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
+test SELECT `a` , `b` FROM `test` . `v1` 2
+test SELECT `b` , `a` FROM `test` . `v1` 2
+test SHOW WARNINGS 10
+test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+DROP VIEW test.v1;
+DROP TABLE test.t1;
diff --git a/mysql-test/suite/perfschema/t/digest_view.test b/mysql-test/suite/perfschema/t/digest_view.test
new file mode 100644
index 00000000000..462d60556eb
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/digest_view.test
@@ -0,0 +1,76 @@
+# ----------------------------------------------------
+# Tests for the performance schema statement Digests.
+# ----------------------------------------------------
+
+# Test case to show behavior of statements digest when
+# using a view
+
+# Test requires: sp-protocol/ps-protocol/view-protocol/cursor-protocol disabled
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+CREATE TABLE test.v1 (a int, b int);
+INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
+
+CREATE TABLE test.t1 (a int, b int);
+INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300);
+
+
+TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
+
+#
+# test.v1 is a table.
+# Every query here is different, and should have a different digest.
+#
+
+EXPLAIN EXTENDED SELECT * from test.v1;
+EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
+EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
+EXPLAIN EXTENDED SELECT a, b from test.v1;
+EXPLAIN EXTENDED SELECT b, a from test.v1;
+
+SELECT * from test.v1;
+SELECT * from test.v1 where a = 1;
+SELECT * from test.v1 where b > 100;
+SELECT a, b from test.v1;
+SELECT b, a from test.v1;
+
+--echo #
+--echo # DIGESTS SEEN ON TABLE
+--echo #
+
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+ FROM performance_schema.events_statements_summary_by_digest
+ ORDER BY DIGEST_TEXT;
+
+DROP TABLE test.v1;
+CREATE VIEW test.v1 AS SELECT * FROM test.t1;
+
+#
+# test.v1 is now a view.
+# the query digests should be unchanged.
+#
+
+EXPLAIN EXTENDED SELECT * from test.v1;
+EXPLAIN EXTENDED SELECT * from test.v1 where a = 1;
+EXPLAIN EXTENDED SELECT * from test.v1 where b > 100;
+EXPLAIN EXTENDED SELECT a, b from test.v1;
+EXPLAIN EXTENDED SELECT b, a from test.v1;
+
+SELECT * from test.v1;
+SELECT * from test.v1 where a = 1;
+SELECT * from test.v1 where b > 100;
+SELECT a, b from test.v1;
+SELECT b, a from test.v1;
+
+--echo #
+--echo # DIGESTS SEEN ON VIEW
+--echo #
+
+SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR
+ FROM performance_schema.events_statements_summary_by_digest
+ ORDER BY DIGEST_TEXT;
+
+DROP VIEW test.v1;
+DROP TABLE test.t1;
+
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 0dfe95e81b0..ba141222168 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -5753,6 +5753,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
if (!s->const_keys.is_clear_all())
{
sargable_cond= get_sargable_cond(join, s->table);
+ bool is_sargable_cond_of_where= sargable_cond == &join->conds;
select= make_select(s->table, found_const_table_map,
found_const_table_map,
@@ -5769,6 +5770,12 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
*/
*sargable_cond= select->cond;
+ if (is_sargable_cond_of_where &&
+ join->conds && join->conds->type() == Item::COND_ITEM &&
+ ((Item_cond*) (join->conds))->functype() ==
+ Item_func::COND_AND_FUNC)
+ join->cond_equal= &((Item_cond_and*) (join->conds))->m_cond_equal;
+
s->quick=select->quick;
s->needed_reg=select->needed_reg;
select->quick=0;
diff --git a/storage/columnstore/CMakeLists.txt b/storage/columnstore/CMakeLists.txt
index 8bfc7893cc7..6669862f038 100644
--- a/storage/columnstore/CMakeLists.txt
+++ b/storage/columnstore/CMakeLists.txt
@@ -31,6 +31,8 @@ CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/columnstore/build/postInstall_storage_engine.sh PARENT_SCOPE)
SET(CPACK_RPM_columnstore-engine_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/columnstore/build/preUn_storage_engine.sh PARENT_SCOPE)
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_VERSION "")
+ SET(CPACK_RPM_columnstore-engine_PACKAGE_SUMMARY "MariaDB ColumnStore storage engine" PARENT_SCOPE)
+ SET(CPACK_RPM_columnstore-engine_PACKAGE_DESCRIPTION "The MariaDB ColumnStore storage engine is a high-performance columnar analytical engine, aimed at rapid processing of analytical queries on very large amounts of data." PARENT_SCOPE)
ENDIF()
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/columnstore")
ENDIF()
diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
index be28528adb0..76deace8fde 100644
--- a/storage/innobase/include/log0log.h
+++ b/storage/innobase/include/log0log.h
@@ -352,26 +352,6 @@ or the MySQL version that created the redo log file. */
header */
#define LOG_FILE_HDR_SIZE (4 * OS_FILE_LOG_BLOCK_SIZE)
-/** Memory mapped file */
-class mapped_file_t
-{
-public:
- mapped_file_t()= default;
- mapped_file_t(const mapped_file_t &)= delete;
- mapped_file_t &operator=(const mapped_file_t &)= delete;
- mapped_file_t(mapped_file_t &&)= delete;
- mapped_file_t &operator=(mapped_file_t &&)= delete;
- ~mapped_file_t() noexcept;
-
- dberr_t map(const char *path, bool read_only= false,
- bool nvme= false) noexcept;
- dberr_t unmap() noexcept;
- byte *data() noexcept { return m_area.data(); }
-
-private:
- span<byte> m_area;
-};
-
/** Abstraction for reading, writing and flushing file cache to disk */
class file_io
{
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index c1cc5ce1108..04b59f33f4e 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -336,12 +336,12 @@ public:
bool is_initialised() const { return last_stored_lsn != 0; }
/** Register a redo log snippet for a page.
- @param page_id page identifier
+ @param it page iterator
@param start_lsn start LSN of the mini-transaction
@param lsn @see mtr_t::commit_lsn()
@param l redo log snippet @see log_t::FORMAT_10_5
@param len length of l, in bytes */
- inline void add(const page_id_t page_id, lsn_t start_lsn, lsn_t lsn,
+ inline void add(map::iterator it, lsn_t start_lsn, lsn_t lsn,
const byte *l, size_t len);
/** Parse and register one mini-transaction in log_t::FORMAT_10_5.
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 0313c6e1df0..349ce4cd7d0 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -224,47 +224,6 @@ void log_t::create()
(aligned_malloc(OS_FILE_LOG_BLOCK_SIZE, OS_FILE_LOG_BLOCK_SIZE));
}
-mapped_file_t::~mapped_file_t() noexcept
-{
- if (!m_area.empty())
- unmap();
-}
-
-dberr_t mapped_file_t::map(const char *path, bool read_only,
- bool nvme) noexcept
-{
- auto fd= mysql_file_open(innodb_log_file_key, path,
- read_only ? O_RDONLY : O_RDWR, MYF(MY_WME));
- if (fd == -1)
- return DB_ERROR;
-
- const auto file_size= os_file_get_size(path).m_total_size;
-
- const int nvme_flag= nvme ? MAP_SYNC : 0;
- void *ptr= my_mmap(0, static_cast<size_t>(file_size),
- read_only ? PROT_READ : PROT_READ | PROT_WRITE,
- MAP_SHARED_VALIDATE | nvme_flag, fd, 0);
- mysql_file_close(fd, MYF(MY_WME));
-
- if (ptr == MAP_FAILED)
- return DB_ERROR;
-
- m_area= {static_cast<byte *>(ptr),
- static_cast<span<byte>::size_type>(file_size)};
- return DB_SUCCESS;
-}
-
-dberr_t mapped_file_t::unmap() noexcept
-{
- ut_ad(!m_area.empty());
-
- if (my_munmap(m_area.data(), m_area.size()))
- return DB_ERROR;
-
- m_area= {};
- return DB_SUCCESS;
-}
-
file_os_io::file_os_io(file_os_io &&rhs) : m_fd(rhs.m_fd)
{
rhs.m_fd= OS_FILE_CLOSED;
@@ -334,6 +293,66 @@ dberr_t file_os_io::flush() noexcept
#include <libpmem.h>
+/** Memory mapped file */
+class mapped_file_t
+{
+public:
+ mapped_file_t()= default;
+ mapped_file_t(const mapped_file_t &)= delete;
+ mapped_file_t &operator=(const mapped_file_t &)= delete;
+ mapped_file_t(mapped_file_t &&)= delete;
+ mapped_file_t &operator=(mapped_file_t &&)= delete;
+ ~mapped_file_t() noexcept;
+
+ dberr_t map(const char *path, bool read_only= false,
+ bool nvme= false) noexcept;
+ dberr_t unmap() noexcept;
+ byte *data() noexcept { return m_area.data(); }
+
+private:
+ span<byte> m_area;
+};
+
+mapped_file_t::~mapped_file_t() noexcept
+{
+ if (!m_area.empty())
+ unmap();
+}
+
+dberr_t mapped_file_t::map(const char *path, bool read_only,
+ bool nvme) noexcept
+{
+ auto fd= mysql_file_open(innodb_log_file_key, path,
+ read_only ? O_RDONLY : O_RDWR, MYF(MY_WME));
+ if (fd == -1)
+ return DB_ERROR;
+
+ const auto file_size= size_t{os_file_get_size(path).m_total_size};
+
+ const int nvme_flag= nvme ? MAP_SYNC : 0;
+ void *ptr=
+ my_mmap(0, file_size, read_only ? PROT_READ : PROT_READ | PROT_WRITE,
+ MAP_SHARED_VALIDATE | nvme_flag, fd, 0);
+ mysql_file_close(fd, MYF(MY_WME));
+
+ if (ptr == MAP_FAILED)
+ return DB_ERROR;
+
+ m_area= {static_cast<byte *>(ptr), file_size};
+ return DB_SUCCESS;
+}
+
+dberr_t mapped_file_t::unmap() noexcept
+{
+ ut_ad(!m_area.empty());
+
+ if (my_munmap(m_area.data(), m_area.size()))
+ return DB_ERROR;
+
+ m_area= {};
+ return DB_SUCCESS;
+}
+
static bool is_pmem(const char *path) noexcept
{
mapped_file_t mf;
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index c83848d02dd..179a9592e7f 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -1971,20 +1971,17 @@ inline void page_recv_t::will_not_read()
/** Register a redo log snippet for a page.
-@param page_id page identifier
+@param it page iterator
@param start_lsn start LSN of the mini-transaction
@param lsn @see mtr_t::commit_lsn()
@param recs redo log snippet @see log_t::FORMAT_10_5
@param len length of l, in bytes */
-inline void recv_sys_t::add(const page_id_t page_id,
- lsn_t start_lsn, lsn_t lsn, const byte *l,
- size_t len)
+inline void recv_sys_t::add(map::iterator it, lsn_t start_lsn, lsn_t lsn,
+ const byte *l, size_t len)
{
mysql_mutex_assert_owner(&mutex);
- std::pair<map::iterator, bool> p= pages.emplace(map::value_type
- (page_id, page_recv_t()));
- page_recv_t& recs= p.first->second;
- ut_ad(p.second == recs.log.empty());
+ page_id_t page_id = it->first;
+ page_recv_t &recs= it->second;
switch (*l & 0x70) {
case FREE_PAGE: case INIT_PAGE:
@@ -2078,6 +2075,7 @@ bool recv_sys_t::parse(lsn_t checkpoint_lsn, store_t *store, bool apply)
loop:
const byte *const log= buf + recovered_offset;
const lsn_t start_lsn= recovered_lsn;
+ map::iterator cached_pages_it = pages.end();
/* Check that the entire mini-transaction is included within the buffer */
const byte *l;
@@ -2401,8 +2399,12 @@ same_page:
/* fall through */
case STORE_YES:
if (!mlog_init.will_avoid_read(id, start_lsn))
- add(id, start_lsn, end_lsn, recs,
+ {
+ if (cached_pages_it == pages.end() || cached_pages_it->first != id)
+ cached_pages_it= pages.emplace(id, page_recv_t()).first;
+ add(cached_pages_it, start_lsn, end_lsn, recs,
static_cast<size_t>(l + rlen - recs));
+ }
continue;
case STORE_NO:
if (!is_init)
@@ -4123,7 +4125,9 @@ completed:
log_sys.last_checkpoint_lsn = checkpoint_lsn;
- if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL) {
+ if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL
+ && (~log_t::FORMAT_ENCRYPTED & log_sys.log.format)
+ == log_t::FORMAT_10_5) {
/* Write a FILE_CHECKPOINT marker as the first thing,
before generating any other redo log. This ensures
that subsequent crash recovery will be possible even
diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index 6051b98b0dd..9b2211503ff 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -128,6 +128,9 @@ IF (CURL_FOUND)
LINK_LIBRARIES curl z STORAGE_ENGINE NOT_EMBEDDED CONFIG s3.cnf)
ENDIF()
+SET(CPACK_RPM_s3-engine_PACKAGE_SUMMARY "Amazon S3 archival storage engine for MariaDB" PARENT_SCOPE)
+SET(CPACK_RPM_s3-engine_PACKAGE_DESCRIPTION "The S3 storage engine allows one to archive MariaDB tables in Amazon S3 (or any third-party public or private cloud that implements S3 API), but still have them accessible in MariaDB in read-only mode." PARENT_SCOPE)
+
IF(TARGET s3)
MYSQL_ADD_EXECUTABLE(aria_s3_copy aria_s3_copy.cc ${S3_SOURCES} COMPONENT s3-engine)
TARGET_LINK_LIBRARIES(aria_s3_copy aria myisam mysys mysys_ssl curl z)
diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt
index b6ad3a9e50d..27afb935467 100644
--- a/storage/mroonga/vendor/groonga/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/CMakeLists.txt
@@ -86,7 +86,9 @@ set(LIB_DIR "lib")
set(INCLUDE_DIR "include")
set(GRN_INCLUDE_DIR "include/groonga")
set(DATA_DIR "share")
-set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}")
+if(NOT DEFINED GRN_DATA_DIR)
+ set(GRN_DATA_DIR "${DATA_DIR}/${GRN_PROJECT_NAME}")
+endif()
set(CONFIG_DIR "etc")
set(GRN_CONFIG_DIR "${CONFIG_DIR}/${GRN_PROJECT_NAME}")
set(GRN_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${GRN_CONFIG_DIR}/groonga.conf")
diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt
index ae083028038..4c2aa343089 100644
--- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt
@@ -16,7 +16,9 @@
# MA 02110-1335 USA
cmake_minimum_required(VERSION 2.6)
-set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql")
+if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_PROJECT_NAME)
+ set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql")
+endif()
project("${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}")
if(DEFINED GROONGA_NORMALIZER_MYSQL_EMBED)
diff --git a/unittest/mysys/thr_template.c b/unittest/mysys/thr_template.c
index 42e035d911c..1e715484687 100644
--- a/unittest/mysys/thr_template.c
+++ b/unittest/mysys/thr_template.c
@@ -59,7 +59,7 @@ int main(int argc __attribute__((unused)), char **argv)
pthread_mutex_init(&mutex, 0);
-#define CYCLES 3000
+#define CYCLES 30000
#define THREADS 30
diag("N CPUs: %d", my_getncpus());