diff --git a/XB_VERSION b/XB_VERSION index e0f9df413256..b1fb7a495c0b 100644 --- a/XB_VERSION +++ b/XB_VERSION @@ -1,4 +1,4 @@ XB_VERSION_MAJOR=8 -XB_VERSION_MINOR=3 +XB_VERSION_MINOR=4 XB_VERSION_PATCH=0 XB_VERSION_EXTRA=-1 diff --git a/client/include/client_priv.h b/client/client_priv.h similarity index 100% rename from client/include/client_priv.h rename to client/client_priv.h diff --git a/client/include/authentication_webauthn_clientopt-case.h b/client/include/authentication_webauthn_clientopt-case.h index cab820a32618..eafa10e4397b 100644 --- a/client/include/authentication_webauthn_clientopt-case.h +++ b/client/include/authentication_webauthn_clientopt-case.h @@ -21,68 +21,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -<<<<<<< HEAD:unittest/gunit/keyring/mock_logger.h -#ifndef MOCK_LOGGER_H -#define MOCK_LOGGER_H -||||||| 824e2b40640:unittest/gunit/keyring/mock_logger.h -#ifndef MOCKLOGGER_H -#define MOCKLOGGER_H -======= #ifndef AUTHENTICATION_WEBAUTHN_CLIENTOPT_CASE_H #define AUTHENTICATION_WEBAUTHN_CLIENTOPT_CASE_H ->>>>>>> mysql-8.4.0:client/include/authentication_webauthn_clientopt-case.h case OPT_AUTHENTICATION_WEBAUTHN_CLIENT_PRESERVE_PRIVACY: opt_authentication_webauthn_client_preserve_privacy = (argument != disabled_my_option); break; -<<<<<<< HEAD:unittest/gunit/keyring/mock_logger.h -#include -#include "plugin/keyring/common/logger.h" - -namespace keyring { -class Mock_logger : public ILogger { - public: - MOCK_METHOD2(log, void(longlong level, const char *msg)); - - void log(longlong level, longlong errcode, ...) override { - char buf[LOG_BUFF_MAX]; - const char *fmt = error_message_for_error_log(errcode); - - va_list vl; - va_start(vl, errcode); - vsnprintf(buf, LOG_BUFF_MAX - 1, fmt, vl); - va_end(vl); - - log(level, buf); - } -}; -} // namespace keyring -#endif // MOCK_LOGGER_H -||||||| 824e2b40640:unittest/gunit/keyring/mock_logger.h -#include -#include "plugin/keyring/common/logger.h" - -namespace keyring { -class Mock_logger : public ILogger { - public: - MOCK_METHOD2(log, void(longlong level, const char *msg)); - - void log(longlong level, longlong errcode, ...) override { - char buf[LOG_BUFF_MAX]; - const char *fmt = error_message_for_error_log(errcode); - - va_list vl; - va_start(vl, errcode); - vsnprintf(buf, LOG_BUFF_MAX - 1, fmt, vl); - va_end(vl); - - log(level, buf); - } -}; -} // namespace keyring -#endif // MOCKLOGGER_H -======= #endif /* AUTHENTICATION_WEBAUTHN_CLIENTOPT_CASE_H */ ->>>>>>> mysql-8.4.0:client/include/authentication_webauthn_clientopt-case.h diff --git a/client/include/sslopt-case.h b/client/include/sslopt-case.h index 4d8b60412fa1..d4d6c81c62fa 100644 --- a/client/include/sslopt-case.h +++ b/client/include/sslopt-case.h @@ -21,22 +21,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -<<<<<<< HEAD:include/sslopt-case.h /** @file include/sslopt-case.h */ - #if defined(MYSQL_SERVER) && !defined(XTRABACKUP) -||||||| 824e2b40640:include/sslopt-case.h -/** - @file include/sslopt-case.h -*/ - -#ifdef MYSQL_SERVER -======= -#ifdef MYSQL_SERVER ->>>>>>> mysql-8.4.0:client/include/sslopt-case.h #error This header is supposed to be used only in the client #endif diff --git a/client/include/sslopt-longopts.h b/client/include/sslopt-longopts.h index ca08aca3ff0c..001e2afdf870 100644 --- a/client/include/sslopt-longopts.h +++ b/client/include/sslopt-longopts.h @@ -25,12 +25,6 @@ @file include/sslopt-longopts.h */ -<<<<<<< HEAD:include/sslopt-longopts.h -#if !defined(MYSQL_SERVER) || defined(XTRABACKUP) -||||||| 824e2b40640:include/sslopt-longopts.h -#ifndef MYSQL_SERVER -======= ->>>>>>> mysql-8.4.0:client/include/sslopt-longopts.h {"ssl-mode", OPT_SSL_MODE, "SSL connection mode.", diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 1ed45c6014ba..f1eb067fb772 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -63,13 +63,7 @@ MACRO(GET_MYSQL_VERSION) MESSAGE(FATAL_ERROR "MYSQL_VERSION file cannot be parsed.") ENDIF() -<<<<<<< HEAD - MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_STABILITY" MYSQL_VERSION_STABILITY MYSQL_VERSION) -||||||| 824e2b40640 - MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_STABILITY" MYSQL_VERSION_STABILITY) -======= - MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MATURITY" MYSQL_VERSION_MATURITY) ->>>>>>> mysql-8.4.0 + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MATURITY" MYSQL_VERSION_MATURITY MYSQL_VERSION) IF(NOT DEFINED MYSQL_VERSION_MATURITY) MESSAGE(FATAL_ERROR "MYSQL_VERSION file cannot be parsed, missing version attributes.") diff --git a/components/keyrings/keyring_file/config/config.cc b/components/keyrings/keyring_file/config/config.cc index 07d881005a4e..3f64b5203793 100644 --- a/components/keyrings/keyring_file/config/config.cc +++ b/components/keyrings/keyring_file/config/config.cc @@ -89,21 +89,13 @@ bool find_and_read_config_file(std::unique_ptr &config_pod, full_path.append(config_file_name); return false; }; -<<<<<<< HEAD - if (set_config_path(path) == true) return true; -#ifdef XTRABACKUP - path = xtrabackup::components::component_config_path; -#endif -||||||| 824e2b40640 - if (set_config_path(path) == true) return true; - -======= if (set_config_path(path) == true) { err = "Failed to set path to configuration file"; return true; } - ->>>>>>> mysql-8.4.0 +#ifdef XTRABACKUP + path = xtrabackup::components::component_config_path; +#endif /* Read config file that's located at shared library location */ std::unique_ptr config_reader(new (std::nothrow) Config_reader(path)); diff --git a/components/test/statement_services/CMakeLists.txt b/components/test/statement_services/CMakeLists.txt index cc842cd79702..1a0189110cdf 100644 --- a/components/test/statement_services/CMakeLists.txt +++ b/components/test/statement_services/CMakeLists.txt @@ -23,52 +23,8 @@ DISABLE_MISSING_PROFILE_WARNING() -<<<<<<< HEAD:plugin/keyring/CMakeLists.txt INCLUDE_DIRECTORIES(SYSTEM ${BOOST_PATCHES_DIR} ${BOOST_INCLUDE_DIR}) -MYSQL_ADD_PLUGIN(keyring_file - buffer.cc - buffered_file_io.cc - checker/checker.cc - checker/checker_factory.cc - checker/checker_ver_1_0.cc - checker/checker_ver_2_0.cc - common/keyring_impl.cc - common/keyring_key.cc - common/keys_container.cc - common/keys_iterator.cc - common/keyring_impl.cc - converter.cc - digest.cc - file_io.cc - hash_to_buffer_serializer.cc - keyring.cc - LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto - MODULE_ONLY - MODULE_OUTPUT_NAME "keyring_file" - ) -||||||| 824e2b40640:plugin/keyring/CMakeLists.txt -MYSQL_ADD_PLUGIN(keyring_file - buffer.cc - buffered_file_io.cc - checker/checker.cc - checker/checker_factory.cc - checker/checker_ver_1_0.cc - checker/checker_ver_2_0.cc - common/keyring_impl.cc - common/keyring_key.cc - common/keys_container.cc - common/keys_iterator.cc - converter.cc - digest.cc - file_io.cc - hash_to_buffer_serializer.cc - keyring.cc - LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto - MODULE_ONLY - MODULE_OUTPUT_NAME "keyring_file" - ) -======= MYSQL_ADD_COMPONENT(test_execute_regular_statement test_execute_regular_statement.cc utils.cc @@ -82,4 +38,3 @@ MYSQL_ADD_COMPONENT(test_execute_prepared_statement MODULE_ONLY TEST_ONLY ) ->>>>>>> mysql-8.4.0:components/test/statement_services/CMakeLists.txt diff --git a/extra/boost/boost_1_77_0/boost/io/detail/buffer_fill.hpp b/extra/boost/boost_1_77_0/boost/io/detail/buffer_fill.hpp deleted file mode 100644 index b25a884473a3..000000000000 --- a/extra/boost/boost_1_77_0/boost/io/detail/buffer_fill.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2019-2020 Glen Joseph Fernandes -(glenjofe@gmail.com) - -Distributed under the Boost Software License, Version 1.0. -(http://www.boost.org/LICENSE_1_0.txt) -*/ -#ifndef BOOST_IO_DETAIL_BUFFER_FILL_HPP -#define BOOST_IO_DETAIL_BUFFER_FILL_HPP - -#include -#include - -namespace boost { -namespace io { -namespace detail { - -template -inline bool -buffer_fill(std::basic_streambuf& buf, charT ch, - std::size_t size) -{ - charT fill[] = { ch, ch, ch, ch, ch, ch, ch, ch }; - enum { - chunk = sizeof fill / sizeof(charT) - }; - for (; size > chunk; size -= chunk) { - if (static_cast(buf.sputn(fill, chunk)) != chunk) { - return false; - } - } - return static_cast(buf.sputn(fill, size)) == size; -} - -} /* detail */ -} /* io */ -} /* boost */ - -#endif diff --git a/extra/boost/boost_1_77_0/boost/io/detail/ostream_guard.hpp b/extra/boost/boost_1_77_0/boost/io/detail/ostream_guard.hpp deleted file mode 100644 index 6999d8134482..000000000000 --- a/extra/boost/boost_1_77_0/boost/io/detail/ostream_guard.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2019-2020 Glen Joseph Fernandes -(glenjofe@gmail.com) - -Distributed under the Boost Software License, Version 1.0. -(http://www.boost.org/LICENSE_1_0.txt) -*/ -#ifndef BOOST_IO_DETAIL_OSTREAM_GUARD_HPP -#define BOOST_IO_DETAIL_OSTREAM_GUARD_HPP - -#include -#include - -namespace boost { -namespace io { -namespace detail { - -template -class ostream_guard { -public: - explicit ostream_guard(std::basic_ostream& os) BOOST_NOEXCEPT - : os_(&os) { } - - ~ostream_guard() BOOST_NOEXCEPT_IF(false) { - if (os_) { - os_->setstate(std::basic_ostream::badbit); - } - } - - void release() BOOST_NOEXCEPT { - os_ = 0; - } - -private: - ostream_guard(const ostream_guard&); - ostream_guard& operator=(const ostream_guard&); - - std::basic_ostream* os_; -}; - -} /* detail */ -} /* io */ -} /* boost */ - -#endif diff --git a/extra/boost/boost_1_77_0/boost/io/ios_state.hpp b/extra/boost/boost_1_77_0/boost/io/ios_state.hpp deleted file mode 100644 index 632a12202d2f..000000000000 --- a/extra/boost/boost_1_77_0/boost/io/ios_state.hpp +++ /dev/null @@ -1,485 +0,0 @@ -/* -Copyright 2002, 2005 Daryle Walker - -Distributed under the Boost Software License, Version 1.0. -(http://www.boost.org/LICENSE_1_0.txt) -*/ -#ifndef BOOST_IO_IOS_STATE_HPP -#define BOOST_IO_IOS_STATE_HPP - -#include -#include -#include -#ifndef BOOST_NO_STD_LOCALE -#include -#endif -#include -#include -#include - -namespace boost { -namespace io { - -class ios_flags_saver { -public: - typedef std::ios_base state_type; - typedef std::ios_base::fmtflags aspect_type; - - explicit ios_flags_saver(state_type& s) - : s_save_(s) - , a_save_(s.flags()) { } - - ios_flags_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.flags(a)) { } - - ~ios_flags_saver() { - this->restore(); - } - - void restore() { - s_save_.flags(a_save_); - } - -private: - ios_flags_saver(const ios_flags_saver&); - ios_flags_saver& operator=(const ios_flags_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -class ios_precision_saver { -public: - typedef std::ios_base state_type; - typedef std::streamsize aspect_type; - - explicit ios_precision_saver(state_type& s) - : s_save_(s) - , a_save_(s.precision()) { } - - ios_precision_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.precision(a)) { } - - ~ios_precision_saver() { - this->restore(); - } - - void restore() { - s_save_.precision(a_save_); - } - -private: - ios_precision_saver(const ios_precision_saver&); - ios_precision_saver& operator=(const ios_precision_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -class ios_width_saver { -public: - typedef std::ios_base state_type; - typedef std::streamsize aspect_type; - - explicit ios_width_saver(state_type& s) - : s_save_(s) - , a_save_(s.width()) { } - - ios_width_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.width(a)) { } - - ~ios_width_saver() { - this->restore(); - } - - void restore() { - s_save_.width(a_save_); - } - -private: - ios_width_saver(const ios_width_saver&); - ios_width_saver& operator=(const ios_width_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -template -class basic_ios_iostate_saver { -public: - typedef std::basic_ios state_type; - typedef std::ios_base::iostate aspect_type; - - explicit basic_ios_iostate_saver(state_type& s) - : s_save_(s) - , a_save_(s.rdstate()) { } - - basic_ios_iostate_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.rdstate()) { - s.clear(a); - } - - ~basic_ios_iostate_saver() { - this->restore(); - } - - void restore() { - s_save_.clear(a_save_); - } - -private: - basic_ios_iostate_saver(const basic_ios_iostate_saver&); - basic_ios_iostate_saver& operator=(const basic_ios_iostate_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -template -class basic_ios_exception_saver { -public: - typedef std::basic_ios state_type; - typedef std::ios_base::iostate aspect_type; - - explicit basic_ios_exception_saver(state_type& s) - : s_save_(s) - , a_save_(s.exceptions()) { } - - basic_ios_exception_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.exceptions()) { - s.exceptions(a); - } - - ~basic_ios_exception_saver() { - this->restore(); - } - - void restore() { - s_save_.exceptions(a_save_); - } - -private: - basic_ios_exception_saver(const basic_ios_exception_saver&); - basic_ios_exception_saver& operator=(const basic_ios_exception_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -template -class basic_ios_tie_saver { -public: - typedef std::basic_ios state_type; - typedef std::basic_ostream* aspect_type; - - explicit basic_ios_tie_saver(state_type& s) - : s_save_(s) - , a_save_(s.tie()) { } - - basic_ios_tie_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.tie(a)) { } - - ~basic_ios_tie_saver() { - this->restore(); - } - - void restore() { - s_save_.tie(a_save_); - } - -private: - basic_ios_tie_saver(const basic_ios_tie_saver&); - basic_ios_tie_saver& operator=(const basic_ios_tie_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -template -class basic_ios_rdbuf_saver { -public: - typedef std::basic_ios state_type; - typedef std::basic_streambuf* aspect_type; - - explicit basic_ios_rdbuf_saver(state_type& s) - : s_save_(s) - , a_save_(s.rdbuf()) { } - - basic_ios_rdbuf_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.rdbuf(a)) { } - - ~basic_ios_rdbuf_saver() { - this->restore(); - } - - void restore() { - s_save_.rdbuf(a_save_); - } - -private: - basic_ios_rdbuf_saver(const basic_ios_rdbuf_saver&); - basic_ios_rdbuf_saver& operator=(const basic_ios_rdbuf_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -template -class basic_ios_fill_saver { -public: - typedef std::basic_ios state_type; - typedef typename state_type::char_type aspect_type; - - explicit basic_ios_fill_saver(state_type& s) - : s_save_(s) - , a_save_(s.fill()) { } - - basic_ios_fill_saver(state_type& s, aspect_type a) - : s_save_(s) - , a_save_(s.fill(a)) { } - - ~basic_ios_fill_saver() { - this->restore(); - } - - void restore() { - s_save_.fill(a_save_); - } - -private: - basic_ios_fill_saver(const basic_ios_fill_saver&); - basic_ios_fill_saver& operator=(const basic_ios_fill_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; - -#ifndef BOOST_NO_STD_LOCALE -template -class basic_ios_locale_saver { -public: - typedef std::basic_ios state_type; - typedef std::locale aspect_type; - - explicit basic_ios_locale_saver(state_type& s) - : s_save_(s) - , a_save_(s.getloc()) { } - - basic_ios_locale_saver(state_type& s, const aspect_type& a) - : s_save_(s) - , a_save_(s.imbue(a)) { } - - ~basic_ios_locale_saver() { - this->restore(); - } - - void restore() { - s_save_.imbue(a_save_); - } - -private: - basic_ios_locale_saver(const basic_ios_locale_saver&); - basic_ios_locale_saver& operator=(const basic_ios_locale_saver&); - - state_type& s_save_; - aspect_type a_save_; -}; -#endif - -class ios_iword_saver { -public: - typedef std::ios_base state_type; - typedef int index_type; - typedef long aspect_type; - - explicit ios_iword_saver(state_type& s, index_type i) - : s_save_(s) - , a_save_(s.iword(i)) - , i_save_(i) { } - - ios_iword_saver(state_type& s, index_type i, aspect_type a) - : s_save_(s) - , a_save_(s.iword(i)) - , i_save_(i) { - s.iword(i) = a; - } - - ~ios_iword_saver() { - this->restore(); - } - - void restore() { - s_save_.iword(i_save_) = a_save_; - } - -private: - ios_iword_saver(const ios_iword_saver&); - ios_iword_saver& operator=(const ios_iword_saver&); - - state_type& s_save_; - aspect_type a_save_; - index_type i_save_; -}; - -class ios_pword_saver { -public: - typedef std::ios_base state_type; - typedef int index_type; - typedef void* aspect_type; - - explicit ios_pword_saver(state_type& s, index_type i) - : s_save_(s) - , a_save_(s.pword(i)) - , i_save_(i) { } - - ios_pword_saver(state_type& s, index_type i, aspect_type a) - : s_save_(s) - , a_save_(s.pword(i)) - , i_save_(i) { - s.pword(i) = a; - } - - ~ios_pword_saver() { - this->restore(); - } - - void restore() { - s_save_.pword(i_save_) = a_save_; - } - -private: - ios_pword_saver(const ios_pword_saver&); - ios_pword_saver operator=(const ios_pword_saver&); - - state_type& s_save_; - aspect_type a_save_; - index_type i_save_; -}; - -class ios_base_all_saver { -public: - typedef std::ios_base state_type; - - explicit ios_base_all_saver(state_type& s) - : s_save_(s) - , a1_save_(s.flags()) - , a2_save_(s.precision()) - , a3_save_(s.width()) { } - - ~ios_base_all_saver() { - this->restore(); - } - - void restore() { - s_save_.width(a3_save_); - s_save_.precision(a2_save_); - s_save_.flags(a1_save_); - } - -private: - ios_base_all_saver(const ios_base_all_saver&); - ios_base_all_saver& operator=(const ios_base_all_saver&); - - state_type& s_save_; - state_type::fmtflags a1_save_; - std::streamsize a2_save_; - std::streamsize a3_save_; -}; - -template -class basic_ios_all_saver { -public: - typedef std::basic_ios state_type; - - explicit basic_ios_all_saver(state_type& s) - : s_save_(s) - , a1_save_(s.flags()) - , a2_save_(s.precision()) - , a3_save_(s.width()) - , a4_save_(s.rdstate()) - , a5_save_(s.exceptions()) - , a6_save_(s.tie()) - , a7_save_(s.rdbuf()) - , a8_save_(s.fill()) -#ifndef BOOST_NO_STD_LOCALE - , a9_save_(s.getloc()) -#endif - { } - - ~basic_ios_all_saver() { - this->restore(); - } - - void restore() { -#ifndef BOOST_NO_STD_LOCALE - s_save_.imbue(a9_save_); -#endif - s_save_.fill(a8_save_); - s_save_.rdbuf(a7_save_); - s_save_.tie(a6_save_); - s_save_.exceptions(a5_save_); - s_save_.clear(a4_save_); - s_save_.width(a3_save_); - s_save_.precision(a2_save_); - s_save_.flags(a1_save_); - } - -private: - basic_ios_all_saver(const basic_ios_all_saver&); - basic_ios_all_saver& operator=(const basic_ios_all_saver&); - - state_type& s_save_; - typename state_type::fmtflags a1_save_; - std::streamsize a2_save_; - std::streamsize a3_save_; - typename state_type::iostate a4_save_; - typename state_type::iostate a5_save_; - std::basic_ostream* a6_save_; - std::basic_streambuf* a7_save_; - typename state_type::char_type a8_save_; -#ifndef BOOST_NO_STD_LOCALE - std::locale a9_save_; -#endif -}; - -class ios_all_word_saver { -public: - typedef std::ios_base state_type; - typedef int index_type; - - ios_all_word_saver(state_type& s, index_type i) - : s_save_(s) - , i_save_(i) - , a1_save_(s.iword(i)) - , a2_save_(s.pword(i)) { } - - ~ios_all_word_saver() { - this->restore(); - } - - void restore() { - s_save_.pword(i_save_) = a2_save_; - s_save_.iword(i_save_) = a1_save_; - } - -private: - ios_all_word_saver(const ios_all_word_saver&); - ios_all_word_saver& operator=(const ios_all_word_saver&); - - state_type& s_save_; - index_type i_save_; - long a1_save_; - void* a2_save_; -}; - -} /* io */ -} /* boost */ - -#endif diff --git a/extra/boost/boost_1_77_0/boost/io/ostream_joiner.hpp b/extra/boost/boost_1_77_0/boost/io/ostream_joiner.hpp deleted file mode 100644 index a771521397ca..000000000000 --- a/extra/boost/boost_1_77_0/boost/io/ostream_joiner.hpp +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2019 Glen Joseph Fernandes -(glenjofe@gmail.com) - -Distributed under the Boost Software License, Version 1.0. -(http://www.boost.org/LICENSE_1_0.txt) -*/ -#ifndef BOOST_IO_OSTREAM_JOINER_HPP -#define BOOST_IO_OSTREAM_JOINER_HPP - -#include -#include -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) -#include -#endif -#include -#endif - -namespace boost { -namespace io { -namespace detail { - -#if !defined(BOOST_NO_CXX11_ADDRESSOF) -template -inline T* -osj_address(T& o) -{ - return std::addressof(o); -} -#else -template -inline T* -osj_address(T& obj) -{ - return &obj; -} -#endif - -} /* detail */ - -template > -class ostream_joiner { -public: - typedef Char char_type; - typedef Traits traits_type; - typedef std::basic_ostream ostream_type; - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - ostream_joiner(ostream_type& output, const Delim& delim) - : output_(detail::osj_address(output)) - , delim_(delim) - , first_(true) { } - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - ostream_joiner(ostream_type& output, Delim&& delim) - : output_(detail::osj_address(output)) - , delim_(std::move(delim)) - , first_(true) { } -#endif - - template - ostream_joiner& operator=(const T& value) { - if (!first_) { - *output_ << delim_; - } - first_ = false; - *output_ << value; - return *this; - } - - ostream_joiner& operator*() BOOST_NOEXCEPT { - return *this; - } - - ostream_joiner& operator++() BOOST_NOEXCEPT { - return *this; - } - - ostream_joiner& operator++(int) BOOST_NOEXCEPT { - return *this; - } - -private: - ostream_type* output_; - Delim delim_; - bool first_; -}; - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) -template -inline ostream_joiner::type, Char, Traits> -make_ostream_joiner(std::basic_ostream& output, Delim&& delim) -{ - return ostream_joiner::type, Char, - Traits>(output, std::forward(delim)); -} -#else -template -inline ostream_joiner -make_ostream_joiner(std::basic_ostream& output, - const Delim& delim) -{ - return ostream_joiner(output, delim); -} -#endif - -} /* io */ -} /* boost */ - -#endif diff --git a/extra/boost/boost_1_77_0/boost/io/ostream_put.hpp b/extra/boost/boost_1_77_0/boost/io/ostream_put.hpp deleted file mode 100644 index 97627f8e81c7..000000000000 --- a/extra/boost/boost_1_77_0/boost/io/ostream_put.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2019 Glen Joseph Fernandes -(glenjofe@gmail.com) - -Distributed under the Boost Software License, Version 1.0. -(http://www.boost.org/LICENSE_1_0.txt) -*/ -#ifndef BOOST_IO_OSTREAM_PUT_HPP -#define BOOST_IO_OSTREAM_PUT_HPP - -#include -#include - -namespace boost { -namespace io { - -template -inline std::basic_ostream& -ostream_put(std::basic_ostream& os, const charT* data, - std::size_t size) -{ - typedef std::basic_ostream stream; - detail::ostream_guard guard(os); - typename stream::sentry entry(os); - if (entry) { - std::basic_streambuf& buf = *os.rdbuf(); - std::size_t width = static_cast(os.width()); - if (width <= size) { - if (static_cast(buf.sputn(data, size)) != size) { - return os; - } - } else if ((os.flags() & stream::adjustfield) == stream::left) { - if (static_cast(buf.sputn(data, size)) != size || - !detail::buffer_fill(buf, os.fill(), width - size)) { - return os; - } - } else if (!detail::buffer_fill(buf, os.fill(), width - size) || - static_cast(buf.sputn(data, size)) != size) { - return os; - } - os.width(0); - } - guard.release(); - return os; -} - -} /* io */ -} /* boost */ - -#endif diff --git a/extra/boost/boost_1_77_0/boost/io/quoted.hpp b/extra/boost/boost_1_77_0/boost/io/quoted.hpp deleted file mode 100644 index fc7d205e822a..000000000000 --- a/extra/boost/boost_1_77_0/boost/io/quoted.hpp +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright 2010 Beman Dawes - -Copyright 2019-2020 Glen Joseph Fernandes -(glenjofe@gmail.com) - -Distributed under the Boost Software License, Version 1.0. -(http://www.boost.org/LICENSE_1_0.txt) -*/ -#ifndef BOOST_IO_QUOTED_HPP -#define BOOST_IO_QUOTED_HPP - -#include -#include -#include - -namespace boost { -namespace io { -namespace detail { - -template -struct quoted_proxy { - String string; - Char escape; - Char delim; -}; - -template -struct quoted_state { - const Char* string; - std::size_t size; - std::size_t count; -}; - -template -inline quoted_state -quoted_start(const Char* string, Char escape, Char delim) -{ - const Char* end = string; - std::size_t count = 2; - for (Char ch; (ch = *end) != 0; ++end) { - count += 1 + (ch == escape || ch == delim); - } - quoted_state state = { string, - static_cast(end - string), count }; - return state; -} - -template -inline quoted_state -quoted_start(const String* string, Char escape, Char delim) -{ - const Char* begin = string->data(); - std::size_t size = string->size(); - std::size_t count = 2; - for (const Char *it = begin, *end = begin + size; it != end; ++it) { - Char ch = *it; - count += 1 + (ch == escape || ch == delim); - } - quoted_state state = { begin, size, count }; - return state; -} - -template -inline bool -quoted_put(std::basic_streambuf& buf, const Char* string, - std::size_t size, std::size_t count, Char escape, Char delim) -{ - if (buf.sputc(delim) == Traits::eof()) { - return false; - } - if (size == count) { - if (static_cast(buf.sputn(string, size)) != size) { - return false; - } - } else { - for (const Char* end = string + size; string != end; ++string) { - Char ch = *string; - if ((ch == escape || ch == delim) && - buf.sputc(escape) == Traits::eof()) { - return false; - } - if (buf.sputc(ch) == Traits::eof()) { - return false; - } - } - } - return buf.sputc(delim) != Traits::eof(); -} - -template -inline std::basic_ostream& -quoted_out(std::basic_ostream& os, String* string, Char escape, - Char delim) -{ - typedef std::basic_ostream stream; - ostream_guard guard(os); - typename stream::sentry entry(os); - if (entry) { - quoted_state state = boost::io::detail::quoted_start(string, - escape, delim); - std::basic_streambuf& buf = *os.rdbuf(); - std::size_t width = static_cast(os.width()); - if (width <= state.count) { - if (!boost::io::detail::quoted_put(buf, state.string, state.size, - state.count, escape, delim)) { - return os; - } - } else if ((os.flags() & stream::adjustfield) == stream::left) { - if (!boost::io::detail::quoted_put(buf, state.string, state.size, - state.count, escape, delim) || - !boost::io::detail::buffer_fill(buf, os.fill(), - width - state.count)) { - return os; - } - } else if (!boost::io::detail::buffer_fill(buf, os.fill(), - width - state.count) || - !boost::io::detail::quoted_put(buf, state.string, state.size, - state.count, escape, delim)) { - return os; - } - os.width(0); - } - guard.release(); - return os; -} - -template -inline std::basic_ostream& -operator<<(std::basic_ostream& os, - const quoted_proxy& proxy) -{ - return boost::io::detail::quoted_out(os, proxy.string, proxy.escape, - proxy.delim); -} - -template -inline std::basic_ostream& -operator<<(std::basic_ostream& os, - const quoted_proxy*, - Char>& proxy) -{ - return boost::io::detail::quoted_out(os, proxy.string, proxy.escape, - proxy.delim); -} - -template -inline std::basic_ostream& -operator<<(std::basic_ostream& os, - const quoted_proxy*, Char>& proxy) -{ - return boost::io::detail::quoted_out(os, proxy.string, proxy.escape, - proxy.delim); -} - -template -inline std::basic_istream& -operator>>(std::basic_istream& is, - const quoted_proxy*, Char>& proxy) -{ - Char ch; - if (!(is >> ch)) { - return is; - } - if (ch != proxy.delim) { - is.unget(); - return is >> *proxy.string; - } - { - boost::io::ios_flags_saver ifs(is); - std::noskipws(is); - proxy.string->clear(); - while ((is >> ch) && ch != proxy.delim) { - if (ch == proxy.escape && !(is >> ch)) { - break; - } - proxy.string->push_back(ch); - } - } - return is; -} - -} /* detail */ - -template -inline detail::quoted_proxy*, - Char> -quoted(const std::basic_string& s, Char escape='\\', - Char delim='\"') -{ - detail::quoted_proxy*, - Char> proxy = { &s, escape, delim }; - return proxy; -} - -template -inline detail::quoted_proxy*, Char> -quoted(std::basic_string& s, Char escape='\\', - Char delim='\"') -{ - detail::quoted_proxy*, - Char> proxy = { &s, escape, delim }; - return proxy; -} - -template -inline detail::quoted_proxy -quoted(const Char* s, Char escape='\\', Char delim='\"') -{ - detail::quoted_proxy proxy = { s, escape, delim }; - return proxy; -} - -} /* io */ -} /* boost */ - -#endif diff --git a/extra/boost/boost_1_84_0/boost/io_fwd.hpp b/extra/boost/boost_1_84_0/boost/io_fwd.hpp new file mode 100644 index 000000000000..deac28a75122 --- /dev/null +++ b/extra/boost/boost_1_84_0/boost/io_fwd.hpp @@ -0,0 +1,63 @@ +/* +Copyright 2002 Daryle Walker + +Distributed under the Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) +*/ +#ifndef BOOST_IO_FWD_HPP +#define BOOST_IO_FWD_HPP + +#include + +namespace boost { +namespace io { + +class ios_flags_saver; +class ios_precision_saver; +class ios_width_saver; +class ios_base_all_saver; + +template > +class basic_ios_iostate_saver; + +template > +class basic_ios_exception_saver; + +template > +class basic_ios_tie_saver; + +template > +class basic_ios_rdbuf_saver; + +template > +class basic_ios_fill_saver; + +template > +class basic_ios_locale_saver; + +template > +class basic_ios_all_saver; + +typedef basic_ios_iostate_saver ios_iostate_saver; +typedef basic_ios_iostate_saver wios_iostate_saver; +typedef basic_ios_exception_saver ios_exception_saver; +typedef basic_ios_exception_saver wios_exception_saver; +typedef basic_ios_tie_saver ios_tie_saver; +typedef basic_ios_tie_saver wios_tie_saver; +typedef basic_ios_rdbuf_saver ios_rdbuf_saver; +typedef basic_ios_rdbuf_saver wios_rdbuf_saver; +typedef basic_ios_fill_saver ios_fill_saver; +typedef basic_ios_fill_saver wios_fill_saver; +typedef basic_ios_locale_saver ios_locale_saver; +typedef basic_ios_locale_saver wios_locale_saver; +typedef basic_ios_all_saver ios_all_saver; +typedef basic_ios_all_saver wios_all_saver; + +class ios_iword_saver; +class ios_pword_saver; +class ios_all_word_saver; + +} // namespace io +} // namespace boost + +#endif diff --git a/extra/boost/boost_1_77_0/boost/random/additive_combine.hpp b/extra/boost/boost_1_84_0/boost/random/additive_combine.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/additive_combine.hpp rename to extra/boost/boost_1_84_0/boost/random/additive_combine.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/bernoulli_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/bernoulli_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/bernoulli_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/bernoulli_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/beta_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/beta_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/beta_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/beta_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/binomial_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/binomial_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/binomial_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/binomial_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/cauchy_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/cauchy_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/cauchy_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/cauchy_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/chi_squared_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/chi_squared_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/chi_squared_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/chi_squared_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/auto_link.hpp b/extra/boost/boost_1_84_0/boost/random/detail/auto_link.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/auto_link.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/auto_link.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/config.hpp b/extra/boost/boost_1_84_0/boost/random/detail/config.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/config.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/config.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/const_mod.hpp b/extra/boost/boost_1_84_0/boost/random/detail/const_mod.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/const_mod.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/const_mod.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/disable_warnings.hpp b/extra/boost/boost_1_84_0/boost/random/detail/disable_warnings.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/disable_warnings.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/disable_warnings.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/enable_warnings.hpp b/extra/boost/boost_1_84_0/boost/random/detail/enable_warnings.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/enable_warnings.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/enable_warnings.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/generator_bits.hpp b/extra/boost/boost_1_84_0/boost/random/detail/generator_bits.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/generator_bits.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/generator_bits.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/generator_seed_seq.hpp b/extra/boost/boost_1_84_0/boost/random/detail/generator_seed_seq.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/generator_seed_seq.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/generator_seed_seq.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/gray_coded_qrng.hpp b/extra/boost/boost_1_84_0/boost/random/detail/gray_coded_qrng.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/gray_coded_qrng.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/gray_coded_qrng.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/int_float_pair.hpp b/extra/boost/boost_1_84_0/boost/random/detail/int_float_pair.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/int_float_pair.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/int_float_pair.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/integer_log2.hpp b/extra/boost/boost_1_84_0/boost/random/detail/integer_log2.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/integer_log2.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/integer_log2.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/iterator_mixin.hpp b/extra/boost/boost_1_84_0/boost/random/detail/iterator_mixin.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/iterator_mixin.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/iterator_mixin.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/large_arithmetic.hpp b/extra/boost/boost_1_84_0/boost/random/detail/large_arithmetic.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/large_arithmetic.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/large_arithmetic.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/mixmax_skip_N17.ipp b/extra/boost/boost_1_84_0/boost/random/detail/mixmax_skip_N17.ipp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/mixmax_skip_N17.ipp rename to extra/boost/boost_1_84_0/boost/random/detail/mixmax_skip_N17.ipp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/niederreiter_base2_table.hpp b/extra/boost/boost_1_84_0/boost/random/detail/niederreiter_base2_table.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/niederreiter_base2_table.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/niederreiter_base2_table.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/operators.hpp b/extra/boost/boost_1_84_0/boost/random/detail/operators.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/operators.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/operators.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/polynomial.hpp b/extra/boost/boost_1_84_0/boost/random/detail/polynomial.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/polynomial.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/polynomial.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/ptr_helper.hpp b/extra/boost/boost_1_84_0/boost/random/detail/ptr_helper.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/ptr_helper.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/ptr_helper.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/qrng_base.hpp b/extra/boost/boost_1_84_0/boost/random/detail/qrng_base.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/qrng_base.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/qrng_base.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/seed.hpp b/extra/boost/boost_1_84_0/boost/random/detail/seed.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/seed.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/seed.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/seed_impl.hpp b/extra/boost/boost_1_84_0/boost/random/detail/seed_impl.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/seed_impl.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/seed_impl.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/signed_unsigned_tools.hpp b/extra/boost/boost_1_84_0/boost/random/detail/signed_unsigned_tools.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/signed_unsigned_tools.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/signed_unsigned_tools.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/sobol_table.hpp b/extra/boost/boost_1_84_0/boost/random/detail/sobol_table.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/sobol_table.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/sobol_table.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/uniform_int_float.hpp b/extra/boost/boost_1_84_0/boost/random/detail/uniform_int_float.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/uniform_int_float.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/uniform_int_float.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/detail/vector_io.hpp b/extra/boost/boost_1_84_0/boost/random/detail/vector_io.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/detail/vector_io.hpp rename to extra/boost/boost_1_84_0/boost/random/detail/vector_io.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/discard_block.hpp b/extra/boost/boost_1_84_0/boost/random/discard_block.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/discard_block.hpp rename to extra/boost/boost_1_84_0/boost/random/discard_block.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/discrete_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/discrete_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/discrete_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/discrete_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/exponential_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/exponential_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/exponential_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/exponential_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/extreme_value_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/extreme_value_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/extreme_value_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/extreme_value_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/faure.hpp b/extra/boost/boost_1_84_0/boost/random/faure.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/faure.hpp rename to extra/boost/boost_1_84_0/boost/random/faure.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/fisher_f_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/fisher_f_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/fisher_f_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/fisher_f_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/gamma_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/gamma_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/gamma_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/gamma_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/generate_canonical.hpp b/extra/boost/boost_1_84_0/boost/random/generate_canonical.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/generate_canonical.hpp rename to extra/boost/boost_1_84_0/boost/random/generate_canonical.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/geometric_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/geometric_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/geometric_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/geometric_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/hyperexponential_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/hyperexponential_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/hyperexponential_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/hyperexponential_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/independent_bits.hpp b/extra/boost/boost_1_84_0/boost/random/independent_bits.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/independent_bits.hpp rename to extra/boost/boost_1_84_0/boost/random/independent_bits.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/inversive_congruential.hpp b/extra/boost/boost_1_84_0/boost/random/inversive_congruential.hpp similarity index 99% rename from extra/boost/boost_1_77_0/boost/random/inversive_congruential.hpp rename to extra/boost/boost_1_84_0/boost/random/inversive_congruential.hpp index b38e28f52c3b..f534b11754bc 100644 --- a/extra/boost/boost_1_77_0/boost/random/inversive_congruential.hpp +++ b/extra/boost/boost_1_84_0/boost/random/inversive_congruential.hpp @@ -129,8 +129,8 @@ class inversive_congruential_engine _value = x0 % modulus; } // handle negative seeds - if(_value <= 0 && _value != 0) { - _value += modulus; + if (_value < 0) { + _value += modulus; } // adjust to the correct range if(increment == 0 && _value == 0) { diff --git a/extra/boost/boost_1_77_0/boost/random/lagged_fibonacci.hpp b/extra/boost/boost_1_84_0/boost/random/lagged_fibonacci.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/lagged_fibonacci.hpp rename to extra/boost/boost_1_84_0/boost/random/lagged_fibonacci.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/laplace_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/laplace_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/laplace_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/laplace_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/linear_congruential.hpp b/extra/boost/boost_1_84_0/boost/random/linear_congruential.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/linear_congruential.hpp rename to extra/boost/boost_1_84_0/boost/random/linear_congruential.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/linear_feedback_shift.hpp b/extra/boost/boost_1_84_0/boost/random/linear_feedback_shift.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/linear_feedback_shift.hpp rename to extra/boost/boost_1_84_0/boost/random/linear_feedback_shift.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/lognormal_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/lognormal_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/lognormal_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/lognormal_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/mersenne_twister.hpp b/extra/boost/boost_1_84_0/boost/random/mersenne_twister.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/mersenne_twister.hpp rename to extra/boost/boost_1_84_0/boost/random/mersenne_twister.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/mixmax.hpp b/extra/boost/boost_1_84_0/boost/random/mixmax.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/mixmax.hpp rename to extra/boost/boost_1_84_0/boost/random/mixmax.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/negative_binomial_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/negative_binomial_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/negative_binomial_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/negative_binomial_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/niederreiter_base2.hpp b/extra/boost/boost_1_84_0/boost/random/niederreiter_base2.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/niederreiter_base2.hpp rename to extra/boost/boost_1_84_0/boost/random/niederreiter_base2.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/non_central_chi_squared_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/non_central_chi_squared_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/non_central_chi_squared_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/non_central_chi_squared_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/normal_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/normal_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/normal_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/normal_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/piecewise_constant_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/piecewise_constant_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/piecewise_constant_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/piecewise_constant_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/piecewise_linear_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/piecewise_linear_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/piecewise_linear_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/piecewise_linear_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/poisson_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/poisson_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/poisson_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/poisson_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/random_device.hpp b/extra/boost/boost_1_84_0/boost/random/random_device.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/random_device.hpp rename to extra/boost/boost_1_84_0/boost/random/random_device.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/random_number_generator.hpp b/extra/boost/boost_1_84_0/boost/random/random_number_generator.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/random_number_generator.hpp rename to extra/boost/boost_1_84_0/boost/random/random_number_generator.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/ranlux.hpp b/extra/boost/boost_1_84_0/boost/random/ranlux.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/ranlux.hpp rename to extra/boost/boost_1_84_0/boost/random/ranlux.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/seed_seq.hpp b/extra/boost/boost_1_84_0/boost/random/seed_seq.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/seed_seq.hpp rename to extra/boost/boost_1_84_0/boost/random/seed_seq.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/shuffle_order.hpp b/extra/boost/boost_1_84_0/boost/random/shuffle_order.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/shuffle_order.hpp rename to extra/boost/boost_1_84_0/boost/random/shuffle_order.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/shuffle_output.hpp b/extra/boost/boost_1_84_0/boost/random/shuffle_output.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/shuffle_output.hpp rename to extra/boost/boost_1_84_0/boost/random/shuffle_output.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/sobol.hpp b/extra/boost/boost_1_84_0/boost/random/sobol.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/sobol.hpp rename to extra/boost/boost_1_84_0/boost/random/sobol.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/student_t_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/student_t_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/student_t_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/student_t_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/subtract_with_carry.hpp b/extra/boost/boost_1_84_0/boost/random/subtract_with_carry.hpp similarity index 95% rename from extra/boost/boost_1_77_0/boost/random/subtract_with_carry.hpp rename to extra/boost/boost_1_84_0/boost/random/subtract_with_carry.hpp index 5dba21ecb1d6..f02f162aec5c 100644 --- a/extra/boost/boost_1_77_0/boost/random/subtract_with_carry.hpp +++ b/extra/boost/boost_1_84_0/boost/random/subtract_with_carry.hpp @@ -244,12 +244,10 @@ class subtract_with_carry_engine * Returns true if the two generators will produce identical * sequences of values. */ - BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(subtract_with_carry_engine, x, y) - { - for(unsigned int j = 0; j < r; ++j) - if(x.compute(j) != y.compute(j)) - return false; - return true; + BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(subtract_with_carry_engine, x_, y) { + for (unsigned int j = 0; j < r; ++j) + if (x_.compute(j) != y.compute(j)) return false; + return true; } /** @@ -268,21 +266,21 @@ class subtract_with_carry_engine friend struct detail::subtract_with_carry_discard; - IntType do_update(std::size_t current, std::size_t short_index, IntType carry) - { - IntType delta; - IntType temp = x[current] + carry; - if (x[short_index] >= temp) { - // x(n) >= 0 - delta = x[short_index] - temp; - carry = 0; - } else { - // x(n) < 0 - delta = modulus - temp + x[short_index]; - carry = 1; - } - x[current] = delta; - return carry; + IntType do_update(std::size_t current, std::size_t short_index, + IntType carry_) { + IntType delta; + IntType temp = x[current] + carry_; + if (x[short_index] >= temp) { + // x(n) >= 0 + delta = x[short_index] - temp; + carry_ = 0; + } else { + // x(n) < 0 + delta = modulus - temp + x[short_index]; + carry_ = 1; + } + x[current] = delta; + return carry_; } /// \endcond @@ -478,12 +476,11 @@ class subtract_with_carry_01_engine } /** Returns true if the two generators will produce identical sequences. */ - BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(subtract_with_carry_01_engine, x, y) - { - for(unsigned int j = 0; j < r; ++j) - if(x.compute(j) != y.compute(j)) - return false; - return true; + BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(subtract_with_carry_01_engine, x_, + y) { + for (unsigned int j = 0; j < r; ++j) + if (x_.compute(j) != y.compute(j)) return false; + return true; } /** Returns true if the two generators will produce different sequences. */ @@ -498,17 +495,17 @@ class subtract_with_carry_01_engine friend struct detail::subtract_with_carry_discard; - RealType do_update(std::size_t current, std::size_t short_index, RealType carry) - { - RealType delta = x[short_index] - x[current] - carry; - if(delta < 0) { - delta += RealType(1); - carry = RealType(1)/_modulus; - } else { - carry = 0; - } - x[current] = delta; - return carry; + RealType do_update(std::size_t current, std::size_t short_index, + RealType carry_) { + RealType delta = x[short_index] - x[current] - carry_; + if (delta < 0) { + delta += RealType(1); + carry_ = RealType(1) / _modulus; + } else { + carry_ = 0; + } + x[current] = delta; + return carry_; } /// \endcond std::size_t k; diff --git a/extra/boost/boost_1_77_0/boost/random/taus88.hpp b/extra/boost/boost_1_84_0/boost/random/taus88.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/taus88.hpp rename to extra/boost/boost_1_84_0/boost/random/taus88.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/traits.hpp b/extra/boost/boost_1_84_0/boost/random/traits.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/traits.hpp rename to extra/boost/boost_1_84_0/boost/random/traits.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/triangle_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/triangle_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/triangle_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/triangle_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/uniform_01.hpp b/extra/boost/boost_1_84_0/boost/random/uniform_01.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/uniform_01.hpp rename to extra/boost/boost_1_84_0/boost/random/uniform_01.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/uniform_int.hpp b/extra/boost/boost_1_84_0/boost/random/uniform_int.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/uniform_int.hpp rename to extra/boost/boost_1_84_0/boost/random/uniform_int.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/uniform_int_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/uniform_int_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/uniform_int_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/uniform_int_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/uniform_on_sphere.hpp b/extra/boost/boost_1_84_0/boost/random/uniform_on_sphere.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/uniform_on_sphere.hpp rename to extra/boost/boost_1_84_0/boost/random/uniform_on_sphere.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/uniform_real.hpp b/extra/boost/boost_1_84_0/boost/random/uniform_real.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/uniform_real.hpp rename to extra/boost/boost_1_84_0/boost/random/uniform_real.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/uniform_real_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/uniform_real_distribution.hpp similarity index 99% rename from extra/boost/boost_1_77_0/boost/random/uniform_real_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/uniform_real_distribution.hpp index ebbc351a603a..9eab9f4bcb4d 100644 --- a/extra/boost/boost_1_77_0/boost/random/uniform_real_distribution.hpp +++ b/extra/boost/boost_1_84_0/boost/random/uniform_real_distribution.hpp @@ -95,7 +95,7 @@ class uniform_real_distribution /** * Constructs the parameters of a uniform_real_distribution. * - * Requires min <= max + * Requires min < max */ explicit param_type(RealType min_arg = RealType(0.0), RealType max_arg = RealType(1.0)) @@ -148,7 +148,7 @@ class uniform_real_distribution * Constructs a uniform_real_distribution. @c min and @c max are * the parameters of the distribution. * - * Requires: min <= max + * Requires: min < max */ explicit uniform_real_distribution( RealType min_arg = RealType(0.0), diff --git a/extra/boost/boost_1_77_0/boost/random/uniform_smallint.hpp b/extra/boost/boost_1_84_0/boost/random/uniform_smallint.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/uniform_smallint.hpp rename to extra/boost/boost_1_84_0/boost/random/uniform_smallint.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/variate_generator.hpp b/extra/boost/boost_1_84_0/boost/random/variate_generator.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/variate_generator.hpp rename to extra/boost/boost_1_84_0/boost/random/variate_generator.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/weibull_distribution.hpp b/extra/boost/boost_1_84_0/boost/random/weibull_distribution.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/weibull_distribution.hpp rename to extra/boost/boost_1_84_0/boost/random/weibull_distribution.hpp diff --git a/extra/boost/boost_1_77_0/boost/random/xor_combine.hpp b/extra/boost/boost_1_84_0/boost/random/xor_combine.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/random/xor_combine.hpp rename to extra/boost/boost_1_84_0/boost/random/xor_combine.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dclass.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dclass.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dclass.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dclass.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dcomp_mem_fun.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dcomp_mem_fun.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dcomp_mem_fun.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dcomp_mem_fun.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dcomp_mem_fun_template.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dcomp_mem_fun_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dcomp_mem_fun_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dcomp_mem_fun_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/ddata.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/ddata.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/ddata.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/ddata.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/ddeftype.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/ddeftype.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/ddeftype.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/ddeftype.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/denclosing_type.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/denclosing_type.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/denclosing_type.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/denclosing_type.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/denum.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/denum.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/denum.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/denum.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dftclass.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dftclass.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dftclass.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dftclass.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dfunction.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dfunction.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dfunction.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dfunction.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dfunction_template.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dfunction_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dfunction_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dfunction_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dlambda.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dlambda.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dlambda.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dlambda.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmacro_fun_template.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmacro_fun_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmacro_fun_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmacro_fun_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmacro_fve.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmacro_fve.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmacro_fve.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmacro_fve.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmacro_sunfix.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmacro_sunfix.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmacro_sunfix.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmacro_sunfix.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmem_data.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmem_data.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmem_data.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmem_data.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmem_fun.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmem_fun.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmem_fun.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmem_fun.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmem_fun_template.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmem_fun_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmem_fun_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmem_fun_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmem_type.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmem_type.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmem_type.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmem_type.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dmetafunc.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dmetafunc.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dmetafunc.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dmetafunc.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dnotype.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dnotype.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dnotype.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dnotype.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dnullptr.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dnullptr.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dnullptr.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dnullptr.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dplaceholder.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dplaceholder.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dplaceholder.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dplaceholder.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dptmf.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dptmf.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dptmf.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dptmf.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dstatic_function_tags.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dstatic_function_tags.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dstatic_function_tags.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dstatic_function_tags.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dstatic_function_type.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dstatic_function_type.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dstatic_function_type.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dstatic_function_type.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dstatic_mem_data.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dstatic_mem_data.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dstatic_mem_data.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dstatic_mem_data.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dstatic_mem_fun.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dstatic_mem_fun.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dstatic_mem_fun.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dstatic_mem_fun.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dstatic_mem_fun_template.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dstatic_mem_fun_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dstatic_mem_fun_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dstatic_mem_fun_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dtclass.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dtclass.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dtclass.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dtclass.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dtemplate.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dtemplate.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dtemplate.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dtemplate.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dtemplate_params.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dtemplate_params.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dtemplate_params.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dtemplate_params.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dtfunction.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dtfunction.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dtfunction.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dtfunction.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dtype.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dtype.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dtype.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dtype.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dunion.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dunion.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dunion.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dunion.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/detail/dvm_template_params.hpp b/extra/boost/boost_1_84_0/boost/tti/detail/dvm_template_params.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/detail/dvm_template_params.hpp rename to extra/boost/boost_1_84_0/boost/tti/detail/dvm_template_params.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_class_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_class_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_class_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_class_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_data_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_data_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_data_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_data_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_enum_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_enum_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_enum_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_enum_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_function_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_function_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_function_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_function_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_function_template_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_function_template_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_function_template_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_function_template_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_member_data_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_member_data_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_member_data_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_member_data_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_member_function_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_member_function_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_member_function_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_member_function_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_member_function_template_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_member_function_template_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_member_function_template_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_member_function_template_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_static_member_data_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_static_member_data_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_static_member_data_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_static_member_data_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_static_member_function_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_static_member_function_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_static_member_function_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_static_member_function_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_static_member_function_template_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_static_member_function_template_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_static_member_function_template_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_static_member_function_template_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_template_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_template_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_template_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_template_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_type_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_type_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_type_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_type_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/has_union_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/has_union_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/has_union_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/has_union_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/member_type_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/member_type_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/member_type_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/member_type_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/gen/namespace_gen.hpp b/extra/boost/boost_1_84_0/boost/tti/gen/namespace_gen.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/gen/namespace_gen.hpp rename to extra/boost/boost_1_84_0/boost/tti/gen/namespace_gen.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_class.hpp b/extra/boost/boost_1_84_0/boost/tti/has_class.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_class.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_class.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_data.hpp b/extra/boost/boost_1_84_0/boost/tti/has_data.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_data.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_data.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_enum.hpp b/extra/boost/boost_1_84_0/boost/tti/has_enum.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_enum.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_enum.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_function.hpp b/extra/boost/boost_1_84_0/boost/tti/has_function.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_function.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_function.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_function_template.hpp b/extra/boost/boost_1_84_0/boost/tti/has_function_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_function_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_function_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_member_data.hpp b/extra/boost/boost_1_84_0/boost/tti/has_member_data.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_member_data.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_member_data.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_member_function.hpp b/extra/boost/boost_1_84_0/boost/tti/has_member_function.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_member_function.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_member_function.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_member_function_template.hpp b/extra/boost/boost_1_84_0/boost/tti/has_member_function_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_member_function_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_member_function_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_static_member_data.hpp b/extra/boost/boost_1_84_0/boost/tti/has_static_member_data.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_static_member_data.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_static_member_data.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_static_member_function.hpp b/extra/boost/boost_1_84_0/boost/tti/has_static_member_function.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_static_member_function.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_static_member_function.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_static_member_function_template.hpp b/extra/boost/boost_1_84_0/boost/tti/has_static_member_function_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_static_member_function_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_static_member_function_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_template.hpp b/extra/boost/boost_1_84_0/boost/tti/has_template.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_template.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_template.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_type.hpp b/extra/boost/boost_1_84_0/boost/tti/has_type.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_type.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_type.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/has_union.hpp b/extra/boost/boost_1_84_0/boost/tti/has_union.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/has_union.hpp rename to extra/boost/boost_1_84_0/boost/tti/has_union.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/member_type.hpp b/extra/boost/boost_1_84_0/boost/tti/member_type.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/member_type.hpp rename to extra/boost/boost_1_84_0/boost/tti/member_type.hpp diff --git a/extra/boost/boost_1_77_0/boost/tti/tti.hpp b/extra/boost/boost_1_84_0/boost/tti/tti.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/tti/tti.hpp rename to extra/boost/boost_1_84_0/boost/tti/tti.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/basic_name_generator.hpp b/extra/boost/boost_1_84_0/boost/uuid/basic_name_generator.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/basic_name_generator.hpp rename to extra/boost/boost_1_84_0/boost/uuid/basic_name_generator.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/config.hpp b/extra/boost/boost_1_84_0/boost/uuid/detail/config.hpp similarity index 77% rename from extra/boost/boost_1_77_0/boost/uuid/detail/config.hpp rename to extra/boost/boost_1_84_0/boost/uuid/detail/config.hpp index 8cd7b7d7b6ec..e99b21a93967 100644 --- a/extra/boost/boost_1_77_0/boost/uuid/detail/config.hpp +++ b/extra/boost/boost_1_84_0/boost/uuid/detail/config.hpp @@ -1,5 +1,5 @@ /* - * Copyright Andrey Semashev 2013. + * Copyright Andrey Semashev 2013, 2022. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * https://www.boost.org/LICENSE_1_0.txt) @@ -36,6 +36,10 @@ #define BOOST_UUID_USE_SSE41 #endif +#if defined(__AVX__) && !defined(BOOST_UUID_USE_AVX) +#define BOOST_UUID_USE_AVX +#endif + #elif defined(_MSC_VER) #if (defined(_M_X64) || (defined(_M_IX86) && defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && !defined(BOOST_UUID_USE_SSE2) @@ -43,6 +47,9 @@ #endif #if defined(__AVX__) +#if !defined(BOOST_UUID_USE_AVX) +#define BOOST_UUID_USE_AVX +#endif #if !defined(BOOST_UUID_USE_SSE41) #define BOOST_UUID_USE_SSE41 #endif @@ -57,6 +64,10 @@ #endif // More advanced ISA extensions imply less advanced are also available +#if !defined(BOOST_UUID_USE_SSE41) && defined(BOOST_UUID_USE_AVX) +#define BOOST_UUID_USE_SSE41 +#endif + #if !defined(BOOST_UUID_USE_SSE3) && defined(BOOST_UUID_USE_SSE41) #define BOOST_UUID_USE_SSE3 #endif @@ -65,7 +76,9 @@ #define BOOST_UUID_USE_SSE2 #endif -#if !defined(BOOST_UUID_NO_SIMD) && !defined(BOOST_UUID_USE_SSE41) && !defined(BOOST_UUID_USE_SSE3) && !defined(BOOST_UUID_USE_SSE2) +#if !defined(BOOST_UUID_NO_SIMD) && !defined(BOOST_UUID_USE_AVX) && \ + !defined(BOOST_UUID_USE_SSE41) && !defined(BOOST_UUID_USE_SSE3) && \ + !defined(BOOST_UUID_USE_SSE2) #define BOOST_UUID_NO_SIMD #endif diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/md5.hpp b/extra/boost/boost_1_84_0/boost/uuid/detail/md5.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/md5.hpp rename to extra/boost/boost_1_84_0/boost/uuid/detail/md5.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider.hpp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider.hpp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_arc4random.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_arc4random.ipp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_arc4random.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_arc4random.ipp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_bcrypt.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_bcrypt.ipp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_bcrypt.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_bcrypt.ipp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_detect_platform.hpp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_detect_platform.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_detect_platform.hpp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_detect_platform.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_getentropy.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_getentropy.ipp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_getentropy.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_getentropy.ipp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_getrandom.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_getrandom.ipp similarity index 93% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_getrandom.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_getrandom.ipp index 036cd4040ff2..cf0e5a57897c 100644 --- a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_getrandom.ipp +++ b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_getrandom.ipp @@ -14,7 +14,7 @@ #include #include -#if !defined(BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_IMPL_GETRANDOM) +#if !defined(BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_IMPL_GETRANDOM) && !defined(BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_DISABLE_LIBC_WRAPPER) #if BOOST_LIB_C_GNU >= BOOST_VERSION_NUMBER(2, 25, 0) #define BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_HAS_LIBC_WRAPPER #elif defined(__has_include) @@ -22,7 +22,7 @@ #define BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_HAS_LIBC_WRAPPER #endif #endif -#endif // !defined(BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_IMPL_GETRANDOM) +#endif // !defined(BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_IMPL_GETRANDOM) && !defined(BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_DISABLE_LIBC_WRAPPER) #if defined(BOOST_UUID_RANDOM_PROVIDER_GETRANDOM_HAS_LIBC_WRAPPER) #include diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_include_platform.hpp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_include_platform.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_include_platform.hpp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_include_platform.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_posix.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_posix.ipp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_posix.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_posix.ipp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_wincrypt.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_wincrypt.ipp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/random_provider_wincrypt.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/random_provider_wincrypt.ipp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/sha1.hpp b/extra/boost/boost_1_84_0/boost/uuid/detail/sha1.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/sha1.hpp rename to extra/boost/boost_1_84_0/boost/uuid/detail/sha1.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/uuid_generic.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/uuid_generic.ipp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/detail/uuid_generic.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/uuid_generic.ipp diff --git a/extra/boost/boost_1_77_0/boost/uuid/detail/uuid_x86.ipp b/extra/boost/boost_1_84_0/boost/uuid/detail/uuid_x86.ipp similarity index 94% rename from extra/boost/boost_1_77_0/boost/uuid/detail/uuid_x86.ipp rename to extra/boost/boost_1_84_0/boost/uuid/detail/uuid_x86.ipp index ecbf9a5d172f..73680afb09b7 100644 --- a/extra/boost/boost_1_77_0/boost/uuid/detail/uuid_x86.ipp +++ b/extra/boost/boost_1_84_0/boost/uuid/detail/uuid_x86.ipp @@ -1,5 +1,5 @@ /* - * Copyright Andrey Semashev 2013. + * Copyright Andrey Semashev 2013, 2022. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * https://www.boost.org/LICENSE_1_0.txt) @@ -22,7 +22,7 @@ #include #endif -#if defined(BOOST_MSVC) && defined(_M_X64) && !defined(BOOST_UUID_USE_SSE3) && (BOOST_MSVC < 1900 /* Fixed in Visual Studio 2015 */ ) +#if defined(BOOST_MSVC) && defined(_M_X64) && (BOOST_MSVC < 1900 /* Fixed in Visual Studio 2015 */ ) // At least MSVC 9 (VS2008) and 12 (VS2013) have an optimizer bug that sometimes results in incorrect SIMD code // generated in Release x64 mode. In particular, it affects operator==, where the compiler sometimes generates // pcmpeqd with a memory opereand instead of movdqu followed by pcmpeqd. The problem is that uuid can be @@ -45,9 +45,7 @@ namespace detail { BOOST_FORCEINLINE __m128i load_unaligned_si128(const uint8_t* p) BOOST_NOEXCEPT { -#if defined(BOOST_UUID_USE_SSE3) - return _mm_lddqu_si128(reinterpret_cast< const __m128i* >(p)); -#elif !defined(BOOST_UUID_DETAIL_MSVC_BUG981648) +#if !defined(BOOST_UUID_DETAIL_MSVC_BUG981648) || defined(BOOST_UUID_USE_AVX) return _mm_loadu_si128(reinterpret_cast< const __m128i* >(p)); #elif defined(BOOST_MSVC) && BOOST_MSVC >= 1600 __m128i mm = _mm_loadu_si128(reinterpret_cast< const __m128i* >(p)); diff --git a/extra/boost/boost_1_77_0/boost/uuid/entropy_error.hpp b/extra/boost/boost_1_84_0/boost/uuid/entropy_error.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/entropy_error.hpp rename to extra/boost/boost_1_84_0/boost/uuid/entropy_error.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/name_generator.hpp b/extra/boost/boost_1_84_0/boost/uuid/name_generator.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/name_generator.hpp rename to extra/boost/boost_1_84_0/boost/uuid/name_generator.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/name_generator_md5.hpp b/extra/boost/boost_1_84_0/boost/uuid/name_generator_md5.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/name_generator_md5.hpp rename to extra/boost/boost_1_84_0/boost/uuid/name_generator_md5.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/name_generator_sha1.hpp b/extra/boost/boost_1_84_0/boost/uuid/name_generator_sha1.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/name_generator_sha1.hpp rename to extra/boost/boost_1_84_0/boost/uuid/name_generator_sha1.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/nil_generator.hpp b/extra/boost/boost_1_84_0/boost/uuid/nil_generator.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/nil_generator.hpp rename to extra/boost/boost_1_84_0/boost/uuid/nil_generator.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/random_generator.hpp b/extra/boost/boost_1_84_0/boost/uuid/random_generator.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/random_generator.hpp rename to extra/boost/boost_1_84_0/boost/uuid/random_generator.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/string_generator.hpp b/extra/boost/boost_1_84_0/boost/uuid/string_generator.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/string_generator.hpp rename to extra/boost/boost_1_84_0/boost/uuid/string_generator.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/uuid.hpp b/extra/boost/boost_1_84_0/boost/uuid/uuid.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/uuid.hpp rename to extra/boost/boost_1_84_0/boost/uuid/uuid.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/uuid_generators.hpp b/extra/boost/boost_1_84_0/boost/uuid/uuid_generators.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/uuid_generators.hpp rename to extra/boost/boost_1_84_0/boost/uuid/uuid_generators.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/uuid_hash.hpp b/extra/boost/boost_1_84_0/boost/uuid/uuid_hash.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/uuid_hash.hpp rename to extra/boost/boost_1_84_0/boost/uuid/uuid_hash.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/uuid_io.hpp b/extra/boost/boost_1_84_0/boost/uuid/uuid_io.hpp similarity index 100% rename from extra/boost/boost_1_77_0/boost/uuid/uuid_io.hpp rename to extra/boost/boost_1_84_0/boost/uuid/uuid_io.hpp diff --git a/extra/boost/boost_1_77_0/boost/uuid/uuid_serialize.hpp b/extra/boost/boost_1_84_0/boost/uuid/uuid_serialize.hpp similarity index 56% rename from extra/boost/boost_1_77_0/boost/uuid/uuid_serialize.hpp rename to extra/boost/boost_1_84_0/boost/uuid/uuid_serialize.hpp index 31312cf01cb0..74fdb3acc627 100644 --- a/extra/boost/boost_1_77_0/boost/uuid/uuid_serialize.hpp +++ b/extra/boost/boost_1_84_0/boost/uuid/uuid_serialize.hpp @@ -12,9 +12,22 @@ #ifndef BOOST_UUID_SERIALIZE_HPP #define BOOST_UUID_SERIALIZE_HPP +#include #include -#include -BOOST_CLASS_IMPLEMENTATION(boost::uuids::uuid, boost::serialization::primitive_type) +// BOOST_CLASS_IMPLEMENTATION(boost::uuids::uuid, +// boost::serialization::primitive_type) + +namespace boost { +namespace serialization { + +template +struct implementation_level_impl; +template <> +struct implementation_level_impl + : boost::integral_constant {}; + +} // namespace serialization +} // namespace boost #endif // BOOST_UUID_SERIALIZE_HPP diff --git a/include/sql_common.h b/include/sql_common.h index 2f606bf7a271..558db7c2a29a 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -211,14 +211,8 @@ struct MYSQL_METHODS { unsigned int field_count); void (*flush_use_result)(MYSQL *mysql, bool flush_all_results); int (*read_change_user_result)(MYSQL *mysql); -<<<<<<< HEAD #if (!defined(MYSQL_SERVER) && !defined(MYSQL_COMPONENT)) || defined(XTRABACKUP) -||||||| 824e2b40640 -#if !defined(MYSQL_SERVER) && !defined(MYSQL_COMPONENT) -======= -#if !defined(MYSQL_SERVER) && !defined(MYSQL_COMPONENT) MYSQL_FIELD *(*list_fields)(MYSQL *mysql); ->>>>>>> mysql-8.4.0 bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); int (*stmt_execute)(MYSQL_STMT *stmt); int (*read_binary_rows)(MYSQL_STMT *stmt); diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 38bf36052f3c..f62dfe22946a 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -22,69 +22,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Copy man pages -<<<<<<< HEAD FILE(GLOB MAN1 *.1) FILE(GLOB MAN1_NDB ndb*.1) FILE(GLOB MAN8 *.8) FILE(GLOB MAN8_NDB ndb*.8) -||||||| 824e2b40640 -SET(MAN1 - comp_err.1 - ibd2sdi.1 - innochecksum.1 - lz4_decompress.1 - my_print_defaults.1 - myisam_ftdump.1 - myisamchk.1 - myisamlog.1 - myisampack.1 - mysql.1 - mysql_config.1 - mysql_config_editor.1 - mysql_secure_installation.1 - mysql_ssl_rsa_setup.1 - mysql_tzinfo_to_sql.1 - mysql_upgrade.1 - mysqladmin.1 - mysqlbinlog.1 - mysqlcheck.1 - mysqldump.1 - mysqldumpslow.1 - mysqlimport.1 - mysqlman.1 - mysqlpump.1 - mysqlshow.1 - mysqlslap.1 - perror.1 - zlib_decompress.1 - ) -======= -SET(MAN1 - comp_err.1 - ibd2sdi.1 - innochecksum.1 - my_print_defaults.1 - myisam_ftdump.1 - myisamchk.1 - myisamlog.1 - myisampack.1 - mysql.1 - mysql_config.1 - mysql_config_editor.1 - mysql_secure_installation.1 - mysql_tzinfo_to_sql.1 - mysqladmin.1 - mysqlbinlog.1 - mysqlcheck.1 - mysqldump.1 - mysqldumpslow.1 - mysqlimport.1 - mysqlman.1 - mysqlshow.1 - mysqlslap.1 - perror.1 - ) ->>>>>>> mysql-8.4.0 IF(MAN1_NDB AND NOT WITH_NDB) LIST(REMOVE_ITEM MAN1 ${MAN1_NDB}) diff --git a/plugin/keyring/buffered_file_io.cc b/plugin/keyring/buffered_file_io.cc deleted file mode 100644 index 14e3daa8bc37..000000000000 --- a/plugin/keyring/buffered_file_io.cc +++ /dev/null @@ -1,588 +0,0 @@ -/* Copyright (c) 2016, 2023, Oracle and/or its affiliates. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2.0, - as published by the Free Software Foundation. - - This program is also distributed with certain software (including - but not limited to OpenSSL) that is licensed under separate terms, - as designated in a particular file or component or in included license - documentation. The authors of MySQL hereby grant you an additional - permission to link the program and your derivative works with the - separately licensed software that they have included with MySQL. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License, version 2.0, for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -#include "plugin/keyring/buffered_file_io.h" - -#include -#include -#include -#include -#include - -#include "my_compiler.h" -#include "my_dbug.h" -#include "my_inttypes.h" -#include "mysqld_error.h" - -namespace keyring { - -extern PSI_memory_key key_memory_KEYRING; -#ifdef HAVE_PSI_INTERFACE -PSI_file_key keyring_file_data_key; -PSI_file_key keyring_backup_file_data_key; - -static PSI_file_info all_keyring_files[] = { - {&keyring_file_data_key, "keyring_file_data", 0, 0, PSI_DOCUMENT_ME}, - {&keyring_backup_file_data_key, "keyring_backup_file_data", 0, 0, - PSI_DOCUMENT_ME}}; - -void keyring_init_psi_file_keys(void) { - const char *category = "keyring_file"; - int count; - - count = static_cast(array_elements(all_keyring_files)); - mysql_file_register(category, all_keyring_files, count); -} -#endif - -/** - constructor taking a single logger output and optional list of format versions - - @param logger - extern logging object for tracing - @param versions - list of allowable file format versions -*/ -Buffered_file_io::Buffered_file_io(ILogger *logger, - std::vector const *versions) - : digest(SHA256, dummy_digest), - memory_needed_for_buffer(0), - file_version(keyring_file_version_2_0), - logger(logger), - file_io(logger), - file_arch(Converter::Arch::UNKNOWN), - native_arch(Converter::get_native_arch()) { - // by default we support only default keyring version - if (versions == nullptr) - checkers.push_back(checker_factory.getCheckerForVersion(file_version)); - else - for (auto const &version : *versions) { - auto checker = checker_factory.getCheckerForVersion(version); - assert(checker != nullptr); - checkers.push_back(std::move(checker)); - } -} - -/** - builds backup file name on-the-fly - - shouldn't be used for write access -*/ -std::string *Buffered_file_io::get_backup_filename() { - // do we have to "build" backup file name - if (unlikely(backup_filename.empty())) { - backup_filename.append(keyring_filename); - backup_filename.append(".backup"); - } - - return &backup_filename; -} - -/** - tries opening backup file and passes file handle on success - - @param backup_file - handle to opened backup file (output) - - @retval false - backup handle was successfully passed via parameter - @retval true - backup file could not be opened (probably missing) -*/ -bool Buffered_file_io::open_backup_file(File *backup_file) { - // try opening backup file - *backup_file = file_io.open(keyring_backup_file_data_key, - get_backup_filename()->c_str(), O_RDONLY, MYF(0)); - - // most probably there was no backup file - return likely(*backup_file < 0); -} - -/** - checks whether keyring file matches any known keyring file structure - - @param file - file handle of keyring file - @param file_size - size of the keyring file - - @retval false - keyring file has valid structure - @retval true - keyring file does not have valid structure -*/ -bool Buffered_file_io::check_file_structure(File file, size_t file_size) { - // check whether keyring file structure matches any of rules - for (auto &checker : checkers) - if (!checker->check_file_structure(file, file_size, &digest, &file_arch)) - return false; // match is found - - // no match was found, keyring file can't be used - logger->log(ERROR_LEVEL, ER_KEYRING_INCORRECT_FILE); - return true; -} - -/** - loads keyring file content into a Buffer serialized object - - only called when keyring is initializing - - @param file - file handle of keyring file - @param buffer - serializable object to store file content to - - @retval false - file is loaded into buffer, or is empty - @retval true - an error has occurred during buffer loading -*/ -bool Buffered_file_io::load_file_into_buffer(File file, Buffer *buffer) { - // position ourselves at file end, leave on failure - if (file_io.seek(file, 0, MY_SEEK_END, MYF(MY_WME)) == MY_FILEPOS_ERROR) - return true; - - // get current file position (size of file) - const my_off_t file_size = file_io.tell(file, MYF(MY_WME)); - if (file_size == ((my_off_t)-1)) return true; - - // we don't load if file's empty - if (file_size == 0) return false; // it is OK if file is empty - - // file structure has to be valid, we also check the architecture - if (check_file_structure(file, file_size)) return true; - - // calculate size required for buffer when wrappers are removed - const size_t digest_length = digest.is_empty ? 0 : SHA256_DIGEST_LENGTH; - size_t input_buffer_size = - file_size - Checker::EOF_TAG_SIZE - file_version.length() - digest_length; - - // we have to be able to move ourselves beyond file version in file - if (file_io.seek(file, file_version.length(), MY_SEEK_SET, MYF(MY_WME)) == - MY_FILEPOS_ERROR) - return true; - - // we'll read if there's something to read - if (likely(input_buffer_size > 0)) { - // do we have file format mismatch - if (file_arch != native_arch) { - // load data to temp buffer - auto tmp = std::make_unique(input_buffer_size); - if (file_io.read(file, tmp.get(), input_buffer_size, MYF(MY_WME)) != - input_buffer_size) - return true; - - // convert data to appropriate format, leave on error - std::string converted; - if (Converter::convert_data(reinterpret_cast(tmp.get()), - input_buffer_size, file_arch, native_arch, - converted)) - return true; - - // prepare buffer size and store converted data - buffer->reserve(converted.length()); - memcpy(buffer->data, converted.c_str(), converted.length()); - } else { - // buffer size has to be memory aligned to machine architecture (size_t) - if (input_buffer_size % sizeof(size_t) != 0) return true; - - // reserve buffer memory and load directly to buffer - buffer->reserve(input_buffer_size); - if (file_io.read(file, buffer->data, input_buffer_size, MYF(MY_WME)) != - input_buffer_size) - return true; - } - } - - // remember current buffer size - memory_needed_for_buffer = buffer->size; - return false; -} - -/** - restores keys from backup file if possible - - backup file has to exist and have a good structure - - backup file is always erased after the procedure - - @retval false - we successfully restored from backup, or no backup - @retval true - we encountered an error while trying to restore -*/ -bool Buffered_file_io::recreate_keyring_from_backup_if_backup_exists() { - // try opening backup file - File backup_file; - if (open_backup_file(&backup_file)) - return false; // if there's no backup file, that's not an error - - // load keyring backup to a buffer - Buffer buffer; - if (load_file_into_buffer(backup_file, &buffer)) { - // backup file is malformed, delete it and emit warning - logger->log(WARNING_LEVEL, ER_KEYRING_FOUND_MALFORMED_BACKUP_FILE); - file_io.close(backup_file, MYF(0)); - - // remove invalid backup and leave, this is still not an error - return remove_backup(MYF(MY_WME)); - } - - // do not create keyring file from the backup if the backup file is empty - if (buffer.size == 0) { - logger->log(WARNING_LEVEL, ER_KEYRING_FAILED_TO_RESTORE_FROM_BACKUP_FILE); - remove_backup(MYF(MY_WME)); - return false; - } - - // try opening or creating main keyring file - const File keyring_file = - file_io.open(keyring_file_data_key, keyring_filename.c_str(), - O_RDWR | O_CREAT, MYF(MY_WME)); - - // copy buffer with backup to main file, leave on any error - if (keyring_file < 0 || flush_buffer_to_storage(&buffer, keyring_file) || - file_io.close(backup_file, MYF(MY_WME)) < 0 || - file_io.close(keyring_file, MYF(MY_WME)) < 0) - - { - // failure to do any of previous steps is an error - logger->log(ERROR_LEVEL, ER_KEYRING_FAILED_TO_RESTORE_FROM_BACKUP_FILE); - return true; - } - - // we restored keyring from backup, so we can remove backup - return remove_backup(MYF(MY_WME)); -} - -/** - checks if keyring file exists, whether empty or not - - if keyring file is empty, it shall be deleted - - @retval false - keyring file can be opened for appending - @retval true - file I/O error (unreadable, missing...) -*/ -bool Buffered_file_io::check_if_keyring_file_can_be_opened_or_created() { - // Check if the file exists - const int file_exist = !my_access(keyring_filename.c_str(), F_OK); - - // try creating file or opening existing - const File file = file_io.open( - keyring_file_data_key, keyring_filename.c_str(), - file_exist && keyring_open_mode ? O_RDONLY : O_RDWR | O_CREAT, - MYF(MY_WME)); - - // if we can't open file or position ourselves at end - it's an error - if (file < 0 || - file_io.seek(file, 0, MY_SEEK_END, MYF(MY_WME)) == MY_FILEPOS_ERROR) - return true; - - // get local file position (i.e. file size), leave on error - const my_off_t file_size = file_io.tell(file, MYF(MY_WME)); - if (((file_size == (my_off_t)-1)) || file_io.close(file, MYF(MY_WME)) < 0) - return true; - - // keyring file is accessible (we can open or create it) - return false; -} - -/** - (override) prepares keyring file for usage - - initialization may include restoring keys from backup file, if available - - if no backup is available, keyring file is either opened or created - - @param keyring_filename - file name of the keyring file to initialize - - @retval true - there was an error with initializing keyring file - @retval false - keyring file has been initialized successfully -*/ -bool Buffered_file_io::init(const std::string *keyring_filename) { - // file name can't be empty - assert(keyring_filename->empty() == false); - -#ifdef HAVE_PSI_INTERFACE - keyring_init_psi_file_keys(); -#endif - - // set internal filename to provided name - this->keyring_filename = *keyring_filename; - - // keys are restored from backup (optional, if available), - // after which we assure that keyring file is accessible - return recreate_keyring_from_backup_if_backup_exists() || - check_if_keyring_file_can_be_opened_or_created(); -} - -/** - stores serialized keys from buffer, and accompanied data to file - - @param buffer - object with serialized keys - @param buffer_digest - file digest sum - @param file - handle of file to store keys to - - @retval false - buffer content successfully copied to file - @retval true - errors occurred during file I/O -*/ -bool Buffered_file_io::flush_buffer_to_file(Buffer *buffer, - Digest *buffer_digest, File file) { - const uchar *data = buffer->data; - size_t data_size = buffer->size; - std::string converted; - - // check whether format conversion is required - if (native_arch != file_arch) { - if (Converter::convert_data(reinterpret_cast(buffer->data), - buffer->size, native_arch, file_arch, - converted)) - return true; - - data = (const uchar *)converted.c_str(); - data_size = converted.length(); - } - - // write file version, buffer content, EOF tag and digest sum to file - if (file_io.write(file, reinterpret_cast(file_version.c_str()), - file_version.length(), - MYF(MY_WME)) == file_version.length() && - file_io.write(file, data, data_size, MYF(MY_WME)) == data_size && - file_io.write( - file, reinterpret_cast(Checker::get_eofTAG().c_str()), - Checker::get_eofTAG().length(), - MYF(MY_WME)) == Checker::get_eofTAG().length() && - file_io.write(file, reinterpret_cast(buffer_digest->value), - SHA256_DIGEST_LENGTH, MYF(0)) == SHA256_DIGEST_LENGTH) - return false; - - // if we're here, some of upper operations failed - logger->log(ERROR_LEVEL, ER_KEYRING_FAILED_TO_FLUSH_KEYRING_TO_FILE); - return true; -} - -/** - verifies that file structure of keyring file is valid - - @param keyring_file - file handle of keyring file - - @retval false - keyring file structure is valid - @retval true - keyring file structure is invalid -*/ -bool Buffered_file_io::check_keyring_file_structure(File keyring_file) { - // if file is missing - either we are currently creating new one, which is ok - // (digest should be set to dummy value), or it was deleted, which is not ok - if (keyring_file < 0) - return strncmp(reinterpret_cast(digest.value), dummy_digest, - SHA256_DIGEST_LENGTH) != 0; - - // try positioning ourself at file end, leave on error - if (file_io.seek(keyring_file, 0, MY_SEEK_END, MYF(MY_WME)) == - MY_FILEPOS_ERROR) - return true; - - // determine current location (i.e. file size), leave on error - const my_off_t file_size = file_io.tell(keyring_file, MYF(MY_WME)); - if (file_size == ((my_off_t)-1)) return true; - - // lets call all available rules to see if any checks out - return check_file_structure(keyring_file, file_size); -} - -/** - (override) fetches serialized object and stores it to a backup file - - serialized object has to point to Buffer implementation - - @param serialized_object - object holding keys to be backed-up - - @retval false - keys from serialized object were stored to backup - @retval true - error occurred during keys backup -*/ -bool Buffered_file_io::flush_to_backup(ISerialized_object *serialized_object) { - // First open backup file then check keyring file. This way we make sure that - // media, where keyring file is written, is not replaced with some other media - // before backup file is written. In case media was changed backup file - // handler becomes invalid - const File backup_file = - file_io.open(keyring_backup_file_data_key, get_backup_filename()->c_str(), - O_WRONLY | O_TRUNC | O_CREAT, MYF(MY_WME)); - - const File keyring_file = file_io.open( - keyring_file_data_key, keyring_filename.c_str(), O_RDONLY, MYF(0)); - - // backup file must be available - if (backup_file < 0) { - // close the keyring file if necessary - if (keyring_file >= 0) file_io.close(keyring_file, MYF(MY_WME)); - return true; // failure - no backup file - } - - // try checking keyring file structure and closing it after that - if (check_keyring_file_structure(keyring_file) || - (keyring_file >= 0 && file_io.close(keyring_file, MYF(MY_WME)) < 0)) { - // close keyring file if necessary - if (keyring_file >= 0) file_io.close(keyring_file, MYF(MY_WME)); - - // close backup and remove it - file_io.close(backup_file, MYF(MY_WME)); - remove_backup(MYF(MY_WME)); - - return true; // failure - bad or missing keyring file - } - - // upcast serialized object to buffer, verify result - Buffer *buffer = dynamic_cast(serialized_object); - assert(buffer != nullptr); - - // calculate digest sum of buffer - Digest buffer_digest; - buffer_digest.compute(buffer->data, buffer->size); - - // hook to crash the server before wiring the keyring backup file - DBUG_EXECUTE_IF("keyring_file_backup_fail", DBUG_SUICIDE();); - - // store buffer to backup file and close it, leave on error - return buffer == nullptr || - flush_buffer_to_file(buffer, &buffer_digest, backup_file) || - file_io.close(backup_file, MYF(MY_WME)) < 0; -} - -/** - deletes backup file from file system - - @param my_flags - flags to be used during file removal - - @retval false - backup file was successfully removed - @retval true - backup file removal failed -*/ -bool Buffered_file_io::remove_backup(myf my_flags) { - return file_io.remove(get_backup_filename()->c_str(), my_flags); -} - -/** - overwrites file with keys from buffer, and associated wrapper data - - @param buffer - object with serialized key to store - @param file - handle of file to store keys to - - @retval false - buffer was successfully stored to a file - @retval true - there was an error during procedure -*/ -bool Buffered_file_io::flush_buffer_to_storage(Buffer *buffer, File file) { - // clear file content and go to start of file, leave on error - if (file_io.truncate(file, MYF(MY_WME)) || - file_io.seek(file, 0, MY_SEEK_SET, MYF(MY_WME)) != 0) - return true; - - // calculate buffer digest - Digest buffer_digest; - buffer_digest.compute(buffer->data, buffer->size); - - // store buffer to a file, leave on error - if (flush_buffer_to_file(buffer, &buffer_digest, file)) return true; - - // remember current file digest - digest = buffer_digest; - return false; -} - -/** - (override) stores keys from serialized object to keyring file - - serialized object has to point to Buffer implementation - - @param serialized_object - object holding keys to be stored - - @retval false - keys from serialized object were stored to keyring file - @retval true - error occurred during store operation -*/ -bool Buffered_file_io::flush_to_storage(ISerialized_object *serialized_object) { - Buffer *buffer = dynamic_cast(serialized_object); - assert(buffer != nullptr); - assert(serialized_object->get_key_operation() != NONE); - - // open keyring file - const File keyring_file = - file_io.open(keyring_file_data_key, keyring_filename.c_str(), - O_CREAT | O_RDWR, MYF(MY_WME)); - - // we need valid keyring file, and writing has to succeed - if (keyring_file < 0 || check_keyring_file_structure(keyring_file) || - flush_buffer_to_storage(buffer, keyring_file)) { - // close keyring file and return error - file_io.close(keyring_file, MYF(MY_WME)); - return true; - } - - // close file and remove backup, leave on error - if (file_io.close(keyring_file, MYF(MY_WME)) < 0 || - remove_backup(MYF(MY_WME))) - return true; - - // store information about memory required for keys in buffer - memory_needed_for_buffer = buffer->size; - return false; -} - -/** - (override) retrieves serialized which creates Buffer implementation from key - hash map - - used to prepare appropriate serialized object for class (Buffer) - - @return - serializer which converts key hash map to a Buffer implementation -*/ -ISerializer *Buffered_file_io::get_serializer() { - hash_to_buffer_serializer.set_memory_needed_for_buffer( - memory_needed_for_buffer); - return &hash_to_buffer_serializer; -} - -/** - (override) retrieves serialized implementation of keys stored in keyring file - - keys object could be empty, if keyring file is empty - - @param serialized_object - pointer-to-pointer of location to store keys - - @return false - set of keys was successfully retrieved from keyring file - @return true - we were not able to retrieve serialized keys -*/ -bool Buffered_file_io::get_serialized_object( - ISerialized_object **serialized_object) { - // Check if the file exists - const int file_exist = !my_access(keyring_filename.c_str(), F_OK); - - // try opening keyring file, leave on error - const File file = file_io.open( - keyring_file_data_key, keyring_filename.c_str(), - file_exist && keyring_open_mode ? O_RDONLY : O_RDWR | O_CREAT, - MYF(MY_WME)); - if (file < 0) return true; - - // try loading file content into a Buffer implementation - std::unique_ptr buffer(new Buffer); - if (load_file_into_buffer(file, buffer.get())) { - // didn't work - close file and pass a null pointer - file_io.close(file, MYF(MY_WME)); - *serialized_object = nullptr; - return true; - } - - // close keyring file, leave on error - if (file_io.close(file, MYF(MY_WME)) < 0) return true; - - // if there were no keys in keyring file, we reset it - if (buffer->size == 0) buffer.reset(nullptr); - - // pass buffer memory to the caller - *serialized_object = buffer.release(); - return false; -} - -/** - (override) verifies if there is more serialized objects in I/O object - - @retval true - there is at least one more serialized object to get - @retval false - there is no more serialized objects to get -*/ -bool Buffered_file_io::has_next_serialized_object() { - // Buffered_file_io implementation uses a single serialized object - return false; -} - -} // namespace keyring diff --git a/plugin/keyring/buffered_file_io.h b/plugin/keyring/buffered_file_io.h deleted file mode 100644 index 23c8387183dd..000000000000 --- a/plugin/keyring/buffered_file_io.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright (c) 2016, 2023, Oracle and/or its affiliates. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2.0, - as published by the Free Software Foundation. - - This program is also distributed with certain software (including - but not limited to OpenSSL) that is licensed under separate terms, - as designated in a particular file or component or in included license - documentation. The authors of MySQL hereby grant you an additional - permission to link the program and your derivative works with the - separately licensed software that they have included with MySQL. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License, version 2.0, for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -#ifndef BUFFEREDFILEIO_INCLUDED -#define BUFFEREDFILEIO_INCLUDED - -#include -#include - -#include "my_inttypes.h" -#include "my_io.h" -#include "plugin/keyring/buffer.h" -#include "plugin/keyring/checker/checker_factory.h" -#include "plugin/keyring/common/i_keyring_io.h" -#include "plugin/keyring/common/keyring.h" -#include "plugin/keyring/common/keyring_memory.h" -#include "plugin/keyring/common/logger.h" -#include "plugin/keyring/digest.h" -#include "plugin/keyring/file_io.h" -#include "plugin/keyring/hash_to_buffer_serializer.h" - -namespace keyring { - -/** - implementation of I/O Keyring interface on top of a (buffered) file -*/ -class Buffered_file_io : public IKeyring_io { - public: - Buffered_file_io(ILogger *logger, - std::vector const *versions = nullptr); - - // ================= IKeyring_io implementation ================= // - - bool init(const std::string *keyring_filename) override; - bool flush_to_backup(ISerialized_object *serialized_object) override; - bool flush_to_storage(ISerialized_object *serialized_object) override; - ISerializer *get_serializer() override; - bool get_serialized_object(ISerialized_object **serialized_object) override; - bool has_next_serialized_object() override; - - protected: - virtual bool remove_backup(myf my_flags); - Buffer buffer; - Digest digest; - size_t memory_needed_for_buffer; - - private: - bool recreate_keyring_from_backup_if_backup_exists(); - - std::string *get_backup_filename(); - bool open_backup_file(File *backup_file); - bool load_file_into_buffer(File file, Buffer *buffer); - bool flush_buffer_to_storage(Buffer *buffer, File file); - bool flush_buffer_to_file(Buffer *buffer, Digest *buffer_digest, File file); - bool check_keyring_file_structure(File keyring_file); - bool check_file_structure(File file, size_t file_size); - bool check_if_keyring_file_can_be_opened_or_created(); - - std::string keyring_filename; - std::string backup_filename; - const std::string file_version; - ILogger *logger; - Hash_to_buffer_serializer hash_to_buffer_serializer; - std::vector> checkers; - CheckerFactory checker_factory; - File_io file_io; - File keyring_file; - Converter::Arch file_arch; - const Converter::Arch native_arch; -}; - -} // namespace keyring - -#endif // BUFFEREDFILEIO_INCLUDED diff --git a/plugin/keyring/keyring.cc b/plugin/keyring/keyring.cc deleted file mode 100644 index 55db2e63e2e6..000000000000 --- a/plugin/keyring/keyring.cc +++ /dev/null @@ -1,268 +0,0 @@ -/* Copyright (c) 2016, 2023, Oracle and/or its affiliates. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2.0, - as published by the Free Software Foundation. - - This program is also distributed with certain software (including - but not limited to OpenSSL) that is licensed under separate terms, - as designated in a particular file or component or in included license - documentation. The authors of MySQL hereby grant you an additional - permission to link the program and your derivative works with the - separately licensed software that they have included with MySQL. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License, version 2.0, for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -#include "my_config.h" - -#include -#include - -#include -#include -#include -#include -#include -#include "my_compiler.h" -#include "my_inttypes.h" -#include "my_io.h" -#include "my_psi_config.h" -#include "mysql/psi/mysql_rwlock.h" -#include "mysqld_error.h" -#include "plugin/keyring/buffered_file_io.h" -#include "plugin/keyring/common/keyring.h" - -#ifdef _WIN32 -#define MYSQL_DEFAULT_KEYRINGFILE MYSQL_KEYRINGDIR "\\keyring" -#else -#define MYSQL_DEFAULT_KEYRINGFILE MYSQL_KEYRINGDIR "/keyring" -#endif - -using keyring::Buffered_file_io; -using keyring::Key; -using keyring::Keys_container; -using keyring::Keys_iterator; -using keyring::Logger; - -mysql_rwlock_t LOCK_keyring; - -int check_keyring_file_data(MYSQL_THD thd [[maybe_unused]], - SYS_VAR *var [[maybe_unused]], void *save, - st_mysql_value *value) { - char buff[FN_REFLEN + 1]; - const char *keyring_filename; - int len = sizeof(buff); - std::unique_ptr new_keys(new Keys_container(logger.get())); - - (*(const char **)save) = nullptr; - keyring_filename = value->val_str(value, buff, &len); - mysql_rwlock_wrlock(&LOCK_keyring); - if (create_keyring_dir_if_does_not_exist(keyring_filename)) { - mysql_rwlock_unlock(&LOCK_keyring); - logger->log(ERROR_LEVEL, ER_KEYRING_FAILED_TO_SET_KEYRING_FILE_DATA); - return 1; - } - try { - IKeyring_io *keyring_io(new Buffered_file_io(logger.get())); - if (new_keys->init(keyring_io, keyring_filename)) { - mysql_rwlock_unlock(&LOCK_keyring); - return 1; - } - *reinterpret_cast(save) = new_keys.get(); - new_keys.release(); - mysql_rwlock_unlock(&LOCK_keyring); - } catch (...) { - mysql_rwlock_unlock(&LOCK_keyring); - return 1; - } - return (0); -} - -static char *keyring_file_data_value = nullptr; -static MYSQL_SYSVAR_STR( - data, /* name */ - keyring_file_data_value, /* value */ - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_NODEFAULT, /* flags */ - "The path to the keyring file. Must be specified", /* comment */ - check_keyring_file_data, /* check() */ - update_keyring_file_data, /* update() */ - MYSQL_DEFAULT_KEYRINGFILE /* default */ -); - -static MYSQL_SYSVAR_BOOL(open_mode, keyring_open_mode, - PLUGIN_VAR_INVISIBLE | PLUGIN_VAR_RQCMDARG, - "Mode in which keyring file should be opened", nullptr, - nullptr, true); - -static SYS_VAR *keyring_file_system_variables[] = { - MYSQL_SYSVAR(data), MYSQL_SYSVAR(open_mode), nullptr}; - -static SERVICE_TYPE(registry) *reg_srv = nullptr; -SERVICE_TYPE(log_builtins) *log_bi = nullptr; -SERVICE_TYPE(log_builtins_string) *log_bs = nullptr; - -static int keyring_init(MYSQL_PLUGIN plugin_info [[maybe_unused]]) { - if (init_logging_service_for_plugin(®_srv, &log_bi, &log_bs)) return true; - - logger.reset(new Logger()); - logger->log(WARNING_LEVEL, ER_SERVER_WARN_DEPRECATED, "keyring_file plugin", - "component_keyring_file"); - - try { - SSL_library_init(); // always returns 1 -#if OPENSSL_VERSION_NUMBER < 0x30000000L - ERR_load_BIO_strings(); - SSL_load_error_strings(); - OpenSSL_add_all_algorithms(); -#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L */ - -#ifdef HAVE_PSI_INTERFACE - keyring_init_psi_keys(); -#endif - - DBUG_EXECUTE_IF("simulate_keyring_init_error", return true;); - - if (init_keyring_locks()) return true; - - if (create_keyring_dir_if_does_not_exist(keyring_file_data_value)) { - logger->log(ERROR_LEVEL, ER_KEYRING_FAILED_TO_CREATE_KEYRING_DIR); - return true; - } - keys.reset(new Keys_container(logger.get())); - std::vector allowedFileVersionsToInit; - // this keyring will work with keyring files in the following versions: - allowedFileVersionsToInit.push_back(keyring::keyring_file_version_2_0); - allowedFileVersionsToInit.push_back(keyring::keyring_file_version_1_0); - IKeyring_io *keyring_io = - new Buffered_file_io(logger.get(), &allowedFileVersionsToInit); - if (keys->init(keyring_io, keyring_file_data_value)) { - is_keys_container_initialized = false; - logger->log(ERROR_LEVEL, ER_KEYRING_FILE_INIT_FAILED); - return true; - } - is_keys_container_initialized = true; - return false; - } catch (...) { - if (logger != nullptr) - logger->log(ERROR_LEVEL, ER_KEYRING_INTERNAL_EXCEPTION_FAILED_FILE_INIT); - deinit_logging_service_for_plugin(®_srv, &log_bi, &log_bs); - return true; - } -} - -static int keyring_deinit(void *arg [[maybe_unused]]) { -// not taking a lock here as the calls to keyring_deinit are serialized by -// the plugin framework -#if OPENSSL_VERSION_NUMBER < 0x10100000L - ERR_remove_thread_state(nullptr); -#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ - ERR_free_strings(); - EVP_cleanup(); - CRYPTO_cleanup_all_ex_data(); - keys.reset(); - logger.reset(); - delete_keyring_file_data(); - mysql_rwlock_destroy(&LOCK_keyring); - - deinit_logging_service_for_plugin(®_srv, &log_bi, &log_bs); - - return 0; -} - -static bool mysql_key_fetch(const char *key_id, char **key_type, - const char *user_id, void **key, size_t *key_len) { - return mysql_key_fetch(key_id, key_type, user_id, key, key_len, - "keyring_file"); -} - -static bool mysql_key_store(const char *key_id, const char *key_type, - const char *user_id, const void *key, - size_t key_len) { - return mysql_key_store(key_id, key_type, user_id, key, key_len, - "keyring_file"); -} - -static bool mysql_key_remove(const char *key_id, const char *user_id) { - return mysql_key_remove(key_id, user_id, "keyring_file"); -} - -static bool mysql_key_generate(const char *key_id, const char *key_type, - const char *user_id, size_t key_len) { - try { - std::unique_ptr key_candidate( - new Key(key_id, key_type, user_id, nullptr, 0)); - - std::unique_ptr key(new uchar[key_len]); - if (key.get() == nullptr) return true; - memset(key.get(), 0, key_len); - if (is_keys_container_initialized == false || - check_key_for_writing(key_candidate.get(), "generating") || - my_rand_buffer(key.get(), key_len)) - return true; - - return mysql_key_store(key_id, key_type, user_id, key.get(), key_len) == - true; - } catch (...) { - if (logger != nullptr) - logger->log(ERROR_LEVEL, ER_KEYRING_FAILED_TO_GENERATE_KEY); - return true; - } -} - -static void mysql_key_iterator_init(void **key_iterator) { - *key_iterator = new Keys_iterator(logger.get()); - if (mysql_key_iterator_init( - static_cast(*key_iterator), "keyring_file") == - true) { - delete static_cast(*key_iterator); - *key_iterator = nullptr; - } -} - -static void mysql_key_iterator_deinit(void *key_iterator) { - mysql_key_iterator_deinit( - static_cast(key_iterator), "keyring_file"); - delete static_cast(key_iterator); -} - -static bool mysql_key_iterator_get_key(void *key_iterator, char *key_id, - char *user_id) { - return mysql_key_iterator_get_key( - static_cast(key_iterator), key_id, user_id, - "keyring_file"); -} - -/* Plugin type-specific descriptor */ -static struct st_mysql_keyring keyring_descriptor = { - MYSQL_KEYRING_INTERFACE_VERSION, - mysql_key_store, - mysql_key_fetch, - mysql_key_remove, - mysql_key_generate, - mysql_key_iterator_init, - mysql_key_iterator_deinit, - mysql_key_iterator_get_key}; - -mysql_declare_plugin(keyring_file){ - MYSQL_KEYRING_PLUGIN, /* type */ - &keyring_descriptor, /* descriptor */ - "keyring_file", /* name */ - PLUGIN_AUTHOR_ORACLE, /* author */ - "store/fetch authentication data to/from a flat file", /* description */ - PLUGIN_LICENSE_GPL, - keyring_init, /* init function (when loaded) */ - nullptr, /* check uninstall function */ - keyring_deinit, /* deinit function (when unloaded) */ - 0x0100, /* version */ - nullptr, /* status variables */ - keyring_file_system_variables, /* system variables */ - nullptr, - PLUGIN_OPT_ALLOW_EARLY, -} mysql_declare_plugin_end; diff --git a/share/messages_to_error_log.txt b/share/messages_to_error_log.txt index d2431cb6929d..ccc463993279 100644 --- a/share/messages_to_error_log.txt +++ b/share/messages_to_error_log.txt @@ -12745,8 +12745,6 @@ ER_IB_MSG_INNODB_FLUSH_METHOD # # End of 8.1, 8.2, 8.3, 8.4 error messages intended to be written to the server error log. # - -<<<<<<< HEAD # # Start of Percona Server 8.0 server error log messages # @@ -12765,10 +12763,6 @@ ER_KEYRING_COMPONENT_KMS_ERROR # End of Percona Server 8.0 server error log messages # -||||||| 824e2b40640 - -======= ->>>>>>> mysql-8.4.0 ################################################################################ # Error numbers 50000 to 51999 are reserved. Please do not use them for # other error messages. diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 052958d06bc1..29ef2325aae3 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -1154,31 +1154,6 @@ ELSE() SET(MYSQLD_SOURCE main.cc) ENDIF() -<<<<<<< HEAD -||||||| 824e2b40640 -MYSQL_ADD_EXECUTABLE(mysqld - ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server - ) - -# We depend on protobuf because of the mysqlx plugin and replication. -IF(UNIX_INSTALL_RPATH_ORIGIN_PRIV_LIBDIR) - ADD_INSTALL_RPATH_FOR_PROTOBUF(mysqld) -ENDIF() - -======= -MYSQL_ADD_EXECUTABLE(mysqld - ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server - ) -# You may want to redirect output for this one, -# the list of exported symbols is loooong. -ADD_OBJDUMP_TARGET(show_mysqld "$" DEPENDS mysqld) - -# We depend on protobuf because of the mysqlx plugin and replication. -IF(UNIX_INSTALL_RPATH_ORIGIN_PRIV_LIBDIR) - ADD_INSTALL_RPATH_FOR_PROTOBUF(mysqld) -ENDIF() - ->>>>>>> mysql-8.4.0 OPTION(DEBUG_EXTNAME "Build server as mysqld-debug (debug builds only)" OFF) MARK_AS_ADVANCED(DEBUG_EXTNAME) diff --git a/sql/derror.cc b/sql/derror.cc index d25252594a43..e443cadb0bdd 100644 --- a/sql/derror.cc +++ b/sql/derror.cc @@ -237,44 +237,10 @@ bool MY_LOCALE_ERRMSGS::read_texts() { if ((file = mysql_file_open(key_file_ERRMSG, fn_format(name, ERRMSG_FILE, lang_path, "", 4), O_RDONLY, MYF(0))) < 0) { -<<<<<<< HEAD - /* - Trying pre-5.5 semantics of the --language parameter. - It included the language-specific part, e.g.: - - --language=/path/to/english/ - */ - if ((file = mysql_file_open( - key_file_ERRMSG, - fn_format(name, ERRMSG_FILE, lc_messages_dir, "", 4), O_RDONLY, - MYF(0))) < 0) { #ifndef XTRABACKUP - LogErr(ERROR_LEVEL, ER_ERRMSG_CANT_FIND_FILE, name); -#endif - goto open_err; - } - - LogErr(WARNING_LEVEL, ER_ERRMSG_LOADING_55_STYLE, lc_messages_dir); -||||||| 824e2b40640 - /* - Trying pre-5.5 semantics of the --language parameter. - It included the language-specific part, e.g.: - - --language=/path/to/english/ - */ - if ((file = mysql_file_open( - key_file_ERRMSG, - fn_format(name, ERRMSG_FILE, lc_messages_dir, "", 4), O_RDONLY, - MYF(0))) < 0) { - LogErr(ERROR_LEVEL, ER_ERRMSG_CANT_FIND_FILE, name); - goto open_err; - } - - LogErr(WARNING_LEVEL, ER_ERRMSG_LOADING_55_STYLE, lc_messages_dir); -======= LogErr(ERROR_LEVEL, ER_ERRMSG_CANT_FIND_FILE, name); +#endif goto open_err; ->>>>>>> mysql-8.4.0 } // Read the header from the file diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 55ad748895c1..1164fb40f42e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1944,15 +1944,7 @@ bool dynamic_plugins_are_initialized = false; static const char *default_dbug_option; #endif -<<<<<<< HEAD #ifndef XTRABACKUP -bool opt_use_ssl = true; -bool opt_use_admin_ssl = true; -||||||| 824e2b40640 -bool opt_use_ssl = true; -bool opt_use_admin_ssl = true; -======= ->>>>>>> mysql-8.4.0 ulong opt_ssl_fips_mode = SSL_FIPS_MODE_OFF; #endif @@ -7066,14 +7058,8 @@ static int init_ssl() { } static int init_ssl_communication() { -<<<<<<< HEAD #if !defined(XTRABACKUP) - if (TLS_channel::singleton_init(&mysql_main, mysql_main_channel, opt_use_ssl, -||||||| 824e2b40640 - if (TLS_channel::singleton_init(&mysql_main, mysql_main_channel, opt_use_ssl, -======= if (TLS_channel::singleton_init(&mysql_main, mysql_main_channel, ->>>>>>> mysql-8.4.0 &server_main_callback, opt_initialize)) return 1; @@ -7093,7 +7079,6 @@ static int init_ssl_communication() { LogErr(SYSTEM_LEVEL, ER_TLS_CONFIGURATION_REUSED, mysql_admin_channel.c_str(), mysql_main_channel.c_str()); } - } #endif #if OPENSSL_VERSION_NUMBER < 0x10100000L @@ -10560,349 +10545,323 @@ struct my_option my_long_early_options[] = { */ struct my_option my_long_options[] = { - {"allow-suspicious-udfs", 0, - "Allows use of UDFs consisting of only one symbol xxx() " - "without corresponding xxx_init() or xxx_deinit(). That also means " - "that one can load any function from any library, for example exit() " - "from libc.so", - &opt_allow_suspicious_udfs, &opt_allow_suspicious_udfs, nullptr, GET_BOOL, - NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"ansi", 'a', - "Use ANSI SQL syntax instead of MySQL syntax. This mode " - "will also set transaction isolation level 'serializable'.", - nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - /* - Because Sys_var_bit does not support command-line options, we need to - explicitly add one for --autocommit - */ - {"autocommit", 0, "Set default value for autocommit (0 or 1)", - &opt_autocommit, &opt_autocommit, nullptr, GET_BOOL, OPT_ARG, 1, 0, 0, - &source_autocommit, /* arg_source, to be copied to Sys_var */ - 0, nullptr}, - {"binlog-do-db", OPT_BINLOG_DO_DB, - "Include only updates to the specified database when writing the " - "binary log.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB, - "Exclude updates to the specified database when writing the binary " - "log.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"character-set-filesystem", 0, "Set the filesystem character set.", - &character_set_filesystem_name, &character_set_filesystem_name, nullptr, - GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"character-set-server", 'C', "Set the default character set.", - &default_character_set_name, &default_character_set_name, nullptr, GET_STR, - REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"chroot", 'r', "Chroot mysqld daemon during startup.", &mysqld_chroot, - &mysqld_chroot, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"collation-server", 0, "Set the default collation.", - &default_collation_name, &default_collation_name, nullptr, GET_STR, - REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"console", OPT_CONSOLE, - "Write error output on screen; don't remove the console window on " - "windows.", - &opt_console, &opt_console, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"core-file", OPT_WANT_CORE, "Write core on errors.", nullptr, nullptr, - nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, - /* default-storage-engine should have "MyISAM" as def_value. Instead - of initializing it here it is done in init_common_variables() due - to a compiler bug in Sun Studio compiler. */ - {"default-storage-engine", 0, "The default storage engine for new tables", - &default_storage_engine, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, - nullptr, 0, nullptr}, - {"default-tmp-storage-engine", 0, - "The default storage engine for new explicit temporary tables", - &default_tmp_storage_engine, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, - 0, nullptr, 0, nullptr}, - {"default-time-zone", 0, "Set the default time zone.", &default_tz_name, - &default_tz_name, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"exit-info", 'T', "Used for debugging. Use at your own risk.", nullptr, - nullptr, nullptr, GET_LONG, OPT_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"external-locking", 0, - "Use system (external) locking (disabled by " - "default). With this option enabled you can run myisamchk to test " - "(not repair) tables while the MySQL server is running. Disable with " - "--skip-external-locking.", - &opt_external_locking, &opt_external_locking, nullptr, GET_BOOL, NO_ARG, 0, - 0, 0, nullptr, 0, nullptr}, - /* We must always support the next option to make scripts like mysqltest - easier to do */ - {"gdb", 0, "Set up signals usable for debugging.", &opt_debugging, - &opt_debugging, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"allow-suspicious-udfs", 0, + "Allows use of UDFs consisting of only one symbol xxx() " + "without corresponding xxx_init() or xxx_deinit(). That also means " + "that one can load any function from any library, for example exit() " + "from libc.so", + &opt_allow_suspicious_udfs, &opt_allow_suspicious_udfs, nullptr, GET_BOOL, + NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"ansi", 'a', + "Use ANSI SQL syntax instead of MySQL syntax. This mode " + "will also set transaction isolation level 'serializable'.", + nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + /* + Because Sys_var_bit does not support command-line options, we need to + explicitly add one for --autocommit + */ + {"autocommit", 0, "Set default value for autocommit (0 or 1)", + &opt_autocommit, &opt_autocommit, nullptr, GET_BOOL, OPT_ARG, 1, 0, 0, + &source_autocommit, /* arg_source, to be copied to Sys_var */ + 0, nullptr}, + {"binlog-do-db", OPT_BINLOG_DO_DB, + "Include only updates to the specified database when writing the " + "binary log.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"binlog-ignore-db", OPT_BINLOG_IGNORE_DB, + "Exclude updates to the specified database when writing the binary " + "log.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"character-set-filesystem", 0, "Set the filesystem character set.", + &character_set_filesystem_name, &character_set_filesystem_name, nullptr, + GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"character-set-server", 'C', "Set the default character set.", + &default_character_set_name, &default_character_set_name, nullptr, GET_STR, + REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"chroot", 'r', "Chroot mysqld daemon during startup.", &mysqld_chroot, + &mysqld_chroot, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"collation-server", 0, "Set the default collation.", &default_collation_name, + &default_collation_name, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"console", OPT_CONSOLE, + "Write error output on screen; don't remove the console window on " + "windows.", + &opt_console, &opt_console, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"core-file", OPT_WANT_CORE, "Write core on errors.", nullptr, nullptr, + nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + /* default-storage-engine should have "MyISAM" as def_value. Instead + of initializing it here it is done in init_common_variables() due + to a compiler bug in Sun Studio compiler. */ + {"default-storage-engine", 0, "The default storage engine for new tables", + &default_storage_engine, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, + nullptr, 0, nullptr}, + {"default-tmp-storage-engine", 0, + "The default storage engine for new explicit temporary tables", + &default_tmp_storage_engine, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, + 0, nullptr, 0, nullptr}, + {"default-time-zone", 0, "Set the default time zone.", &default_tz_name, + &default_tz_name, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"exit-info", 'T', "Used for debugging. Use at your own risk.", nullptr, + nullptr, nullptr, GET_LONG, OPT_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"external-locking", 0, + "Use system (external) locking (disabled by " + "default). With this option enabled you can run myisamchk to test " + "(not repair) tables while the MySQL server is running. Disable with " + "--skip-external-locking.", + &opt_external_locking, &opt_external_locking, nullptr, GET_BOOL, NO_ARG, 0, + 0, 0, nullptr, 0, nullptr}, + /* We must always support the next option to make scripts like mysqltest + easier to do */ + {"gdb", 0, "Set up signals usable for debugging.", &opt_debugging, + &opt_debugging, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, #if defined(HAVE_LINUX_LARGE_PAGES) || defined(HAVE_SOLARIS_LARGE_PAGES) - {"super-large-pages", 0, "Enable support for super large pages.", - &opt_super_large_pages, &opt_super_large_pages, nullptr, GET_BOOL, OPT_ARG, - 0, 0, 1, nullptr, 1, nullptr}, + {"super-large-pages", 0, "Enable support for super large pages.", + &opt_super_large_pages, &opt_super_large_pages, nullptr, GET_BOOL, OPT_ARG, + 0, 0, 1, nullptr, 1, nullptr}, #endif - {"lc-messages", 0, "Set the language used for the error messages.", - &lc_messages, &lc_messages, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, - nullptr, 0, nullptr}, - {"lc-time-names", 0, - "Set the language used for the month names and the days of the week.", - &lc_time_names_name, &lc_time_names_name, nullptr, GET_STR, REQUIRED_ARG, - 0, 0, 0, nullptr, 0, nullptr}, - {"log-bin", OPT_BIN_LOG, - "Configures the name prefix to use for binary log files. If the --log-bin " - "option is not supplied, the name prefix defaults to \"binlog\". If the " - "--log-bin option is supplied without argument, the name prefix defaults " - "to \"HOSTNAME-bin\", where HOSTNAME is the machine's hostname. To set a " - "different name prefix for binary log files, use --log-bin=name. To " - "disable " - "binary logging, use the --skip-log-bin or --disable-log-bin option.", - &opt_bin_logname, &opt_bin_logname, nullptr, GET_STR_ALLOC, OPT_ARG, 0, 0, - 0, nullptr, 0, nullptr}, - {"log-bin-index", 0, "File that holds the names for binary log files.", - &opt_binlog_index_name, &opt_binlog_index_name, nullptr, GET_STR, - REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"relay-log-index", 0, "File that holds the names for relay log files.", - &opt_relaylog_index_name, &opt_relaylog_index_name, nullptr, GET_STR, - REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.", - &myisam_log_filename, &myisam_log_filename, nullptr, GET_STR, OPT_ARG, 0, - 0, 0, nullptr, 0, nullptr}, - {"log-short-format", 0, - "Don't log extra information to update and slow-query logs.", - &opt_short_log_format, &opt_short_log_format, nullptr, GET_BOOL, NO_ARG, 0, - 0, 0, nullptr, 0, nullptr}, - {"log-tc", 0, - "Path to transaction coordinator log (used for transactions that affect " - "more than one storage engine, when binary log is disabled).", - &opt_tc_log_file, &opt_tc_log_file, nullptr, GET_STR, REQUIRED_ARG, 0, 0, - 0, nullptr, 0, nullptr}, - {"log-tc-size", 0, "Size of transaction coordinator log.", &opt_tc_log_size, - &opt_tc_log_size, nullptr, GET_ULONG, REQUIRED_ARG, - TC_LOG_MIN_PAGES *my_getpagesize(), TC_LOG_MIN_PAGES *my_getpagesize(), - ULONG_MAX, nullptr, my_getpagesize(), nullptr}, - {"master-retry-count", OPT_MASTER_RETRY_COUNT, - "The number of times this replica will attempt to connect to a source " - "before giving up. " - "This option is deprecated and will be removed in a future version. " - "Use 'CHANGE REPLICATION SOURCE TO SOURCE_RETRY_COUNT = ' instead.", - &source_retry_count, &source_retry_count, nullptr, GET_ULONG, REQUIRED_ARG, - 10, 0, 0, nullptr, 0, nullptr}, - {"max-binlog-dump-events", 0, - "Option used by mysql-test for debugging and testing of replication.", - &max_binlog_dump_events, &max_binlog_dump_events, nullptr, GET_INT, - REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"memlock", 0, "Lock mysqld in memory.", &locked_in_memory, - &locked_in_memory, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"port-open-timeout", 0, - "Maximum time in seconds to wait for the port to become free. " - "(Default: No wait).", - &mysqld_port_timeout, &mysqld_port_timeout, nullptr, GET_UINT, - REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"replicate-do-db", OPT_REPLICATE_DO_DB, - "Make replication applier threads apply only changes to the specified " - "database. " - "To specify more than one database, use the directive multiple times, " - "once for each database. Note that this will only work if you do not use " - "cross-database queries such as UPDATE some_db.some_table SET foo='bar' " - "while having selected a different or no database. If you need cross " - "database updates to work, make sure you have 3.23.28 or later, and use " - "replicate-wild-do-table=db_name.%.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"replicate-do-table", OPT_REPLICATE_DO_TABLE, - "Make replication applier threads apply only changes to the specified " - "table. " - "To specify more than one table, use the directive multiple times, once " - "for each table. This will work for cross-database updates, in contrast " - "to replicate-do-db.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"replicate-ignore-db", OPT_REPLICATE_IGNORE_DB, - "Make replication applier threads skip changes to the specified " - "database. " - "To specify more than one database to ignore, use this option multiple " - "times, once for each database. If there are statements that update " - "multiple databases, this will work correctly only when the source " - "server uses binlog_format=ROW.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"replicate-ignore-table", OPT_REPLICATE_IGNORE_TABLE, - "Make replication applier threads skip changes to the specified table." - "To ignore more than one table, use the option multiple times, once for " - "each table. If there are statements that update multiple tables, this " - "will work correctly only when the source server uses binlog_format=ROW.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"replicate-rewrite-db", OPT_REPLICATE_REWRITE_DB, - "Make replication applier threads rename a database, so changes in one " - "database on the source will be applied in another database on this " - "replica. Example: " - "replicate-rewrite-db=source_db_name->replica_db_name.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"replicate-same-server-id", 0, - "In replication, if set to 1, do not skip events having our server id. " - "Default value is 0 (to break infinite loops in circular replication). " - "Can't be set to 1 if --log-replica-updates is used.", - &replicate_same_server_id, &replicate_same_server_id, nullptr, GET_BOOL, - NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"replicate-wild-do-table", OPT_REPLICATE_WILD_DO_TABLE, - "Make replication applier threads apply changes only in tables that " - "match the specified wildcard pattern. To specify more than one pattern, " - "use the option multiple times, once for each pattern. If there are " - "statements that update both tables that are included and excluded by " - "the pattern, this will only work correctly when the source server uses " - "binlog_format=ROW. " - "Example: replicate-wild-do-table=foo%.bar% will " - "replicate only updates to tables in all databases that start with foo " - "and whose table names start with bar.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"replicate-wild-ignore-table", OPT_REPLICATE_WILD_IGNORE_TABLE, - "Make replication applier threads skip changes to tables that match " - "the specified wildcard pattern. To specify more than one pattern, use " - "the option multiple times, once for each pattern. If there are " - "statements that update both tables that are included and tables that " - "are excluded by the pattern, this will only work correctly when the " - "source server uses binlog_format=ROW. " - "Example: when using replicate-wild-ignore-table=foo%.bar%, " - "the applier thread will not apply updates to tables in databases that " - "start with foo and whose table names start with bar.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"safe-user-create", 0, - "Don't allow new user creation by the user who has no write privileges to " - "the mysql.user table.", - &opt_safe_user_create, &opt_safe_user_create, nullptr, GET_BOOL, NO_ARG, 0, - 0, 0, nullptr, 0, nullptr}, - {"show-replica-auth-info", 0, - "Include user and password in SHOW REPLICAS statements.", - &opt_show_replica_auth_info, &opt_show_replica_auth_info, nullptr, - GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO_DEPRECATED, - "This option is deprecated and will be removed in a future version. " - "Use show-replica-auth-info instead.", - &opt_show_replica_auth_info, &opt_show_replica_auth_info, nullptr, - GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"skip-new", OPT_SKIP_NEW, "Don't use new, possibly wrong routines.", - nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"skip-stack-trace", OPT_SKIP_STACK_TRACE, - "Don't print a stack trace on failure.", nullptr, nullptr, nullptr, - GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"lc-messages", 0, "Set the language used for the error messages.", + &lc_messages, &lc_messages, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, + 0, nullptr}, + {"lc-time-names", 0, + "Set the language used for the month names and the days of the week.", + &lc_time_names_name, &lc_time_names_name, nullptr, GET_STR, REQUIRED_ARG, 0, + 0, 0, nullptr, 0, nullptr}, + {"log-bin", OPT_BIN_LOG, + "Configures the name prefix to use for binary log files. If the --log-bin " + "option is not supplied, the name prefix defaults to \"binlog\". If the " + "--log-bin option is supplied without argument, the name prefix defaults " + "to \"HOSTNAME-bin\", where HOSTNAME is the machine's hostname. To set a " + "different name prefix for binary log files, use --log-bin=name. To " + "disable " + "binary logging, use the --skip-log-bin or --disable-log-bin option.", + &opt_bin_logname, &opt_bin_logname, nullptr, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, + nullptr, 0, nullptr}, + {"log-bin-index", 0, "File that holds the names for binary log files.", + &opt_binlog_index_name, &opt_binlog_index_name, nullptr, GET_STR, + REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"relay-log-index", 0, "File that holds the names for relay log files.", + &opt_relaylog_index_name, &opt_relaylog_index_name, nullptr, GET_STR, + REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.", + &myisam_log_filename, &myisam_log_filename, nullptr, GET_STR, OPT_ARG, 0, 0, + 0, nullptr, 0, nullptr}, + {"log-short-format", 0, + "Don't log extra information to update and slow-query logs.", + &opt_short_log_format, &opt_short_log_format, nullptr, GET_BOOL, NO_ARG, 0, + 0, 0, nullptr, 0, nullptr}, + {"log-tc", 0, + "Path to transaction coordinator log (used for transactions that affect " + "more than one storage engine, when binary log is disabled).", + &opt_tc_log_file, &opt_tc_log_file, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, + nullptr, 0, nullptr}, + {"log-tc-size", 0, "Size of transaction coordinator log.", &opt_tc_log_size, + &opt_tc_log_size, nullptr, GET_ULONG, REQUIRED_ARG, + TC_LOG_MIN_PAGES * my_getpagesize(), TC_LOG_MIN_PAGES * my_getpagesize(), + ULONG_MAX, nullptr, my_getpagesize(), nullptr}, + {"master-retry-count", OPT_MASTER_RETRY_COUNT, + "The number of times this replica will attempt to connect to a source " + "before giving up. " + "This option is deprecated and will be removed in a future version. " + "Use 'CHANGE REPLICATION SOURCE TO SOURCE_RETRY_COUNT = ' instead.", + &source_retry_count, &source_retry_count, nullptr, GET_ULONG, REQUIRED_ARG, + 10, 0, 0, nullptr, 0, nullptr}, + {"max-binlog-dump-events", 0, + "Option used by mysql-test for debugging and testing of replication.", + &max_binlog_dump_events, &max_binlog_dump_events, nullptr, GET_INT, + REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"memlock", 0, "Lock mysqld in memory.", &locked_in_memory, &locked_in_memory, + nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"port-open-timeout", 0, + "Maximum time in seconds to wait for the port to become free. " + "(Default: No wait).", + &mysqld_port_timeout, &mysqld_port_timeout, nullptr, GET_UINT, REQUIRED_ARG, + 0, 0, 0, nullptr, 0, nullptr}, + {"replicate-do-db", OPT_REPLICATE_DO_DB, + "Make replication applier threads apply only changes to the specified " + "database. " + "To specify more than one database, use the directive multiple times, " + "once for each database. Note that this will only work if you do not use " + "cross-database queries such as UPDATE some_db.some_table SET foo='bar' " + "while having selected a different or no database. If you need cross " + "database updates to work, make sure you have 3.23.28 or later, and use " + "replicate-wild-do-table=db_name.%.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"replicate-do-table", OPT_REPLICATE_DO_TABLE, + "Make replication applier threads apply only changes to the specified " + "table. " + "To specify more than one table, use the directive multiple times, once " + "for each table. This will work for cross-database updates, in contrast " + "to replicate-do-db.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"replicate-ignore-db", OPT_REPLICATE_IGNORE_DB, + "Make replication applier threads skip changes to the specified " + "database. " + "To specify more than one database to ignore, use this option multiple " + "times, once for each database. If there are statements that update " + "multiple databases, this will work correctly only when the source " + "server uses binlog_format=ROW.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"replicate-ignore-table", OPT_REPLICATE_IGNORE_TABLE, + "Make replication applier threads skip changes to the specified table." + "To ignore more than one table, use the option multiple times, once for " + "each table. If there are statements that update multiple tables, this " + "will work correctly only when the source server uses binlog_format=ROW.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"replicate-rewrite-db", OPT_REPLICATE_REWRITE_DB, + "Make replication applier threads rename a database, so changes in one " + "database on the source will be applied in another database on this " + "replica. Example: " + "replicate-rewrite-db=source_db_name->replica_db_name.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"replicate-same-server-id", 0, + "In replication, if set to 1, do not skip events having our server id. " + "Default value is 0 (to break infinite loops in circular replication). " + "Can't be set to 1 if --log-replica-updates is used.", + &replicate_same_server_id, &replicate_same_server_id, nullptr, GET_BOOL, + NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"replicate-wild-do-table", OPT_REPLICATE_WILD_DO_TABLE, + "Make replication applier threads apply changes only in tables that " + "match the specified wildcard pattern. To specify more than one pattern, " + "use the option multiple times, once for each pattern. If there are " + "statements that update both tables that are included and excluded by " + "the pattern, this will only work correctly when the source server uses " + "binlog_format=ROW. " + "Example: replicate-wild-do-table=foo%.bar% will " + "replicate only updates to tables in all databases that start with foo " + "and whose table names start with bar.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"replicate-wild-ignore-table", OPT_REPLICATE_WILD_IGNORE_TABLE, + "Make replication applier threads skip changes to tables that match " + "the specified wildcard pattern. To specify more than one pattern, use " + "the option multiple times, once for each pattern. If there are " + "statements that update both tables that are included and tables that " + "are excluded by the pattern, this will only work correctly when the " + "source server uses binlog_format=ROW. " + "Example: when using replicate-wild-ignore-table=foo%.bar%, " + "the applier thread will not apply updates to tables in databases that " + "start with foo and whose table names start with bar.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"safe-user-create", 0, + "Don't allow new user creation by the user who has no write privileges to " + "the mysql.user table.", + &opt_safe_user_create, &opt_safe_user_create, nullptr, GET_BOOL, NO_ARG, 0, + 0, 0, nullptr, 0, nullptr}, + {"show-replica-auth-info", 0, + "Include user and password in SHOW REPLICAS statements.", + &opt_show_replica_auth_info, &opt_show_replica_auth_info, nullptr, GET_BOOL, + NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO_DEPRECATED, + "This option is deprecated and will be removed in a future version. " + "Use show-replica-auth-info instead.", + &opt_show_replica_auth_info, &opt_show_replica_auth_info, nullptr, GET_BOOL, + NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"skip-new", OPT_SKIP_NEW, "Don't use new, possibly wrong routines.", nullptr, + nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"skip-stack-trace", OPT_SKIP_STACK_TRACE, + "Don't print a stack trace on failure.", nullptr, nullptr, nullptr, + GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, #if defined(_WIN32) - {"slow-start-timeout", 0, - "Maximum number of milliseconds that the service control manager should " - "wait " - "before trying to kill the windows service during startup" - "(Default: 15000).", - &slow_start_timeout, &slow_start_timeout, nullptr, GET_ULONG, REQUIRED_ARG, - 15000, 0, 0, nullptr, 0, nullptr}, + {"slow-start-timeout", 0, + "Maximum number of milliseconds that the service control manager should " + "wait " + "before trying to kill the windows service during startup" + "(Default: 15000).", + &slow_start_timeout, &slow_start_timeout, nullptr, GET_ULONG, REQUIRED_ARG, + 15000, 0, 0, nullptr, 0, nullptr}, #endif - {"sporadic-binlog-dump-fail", 0, - "Option used by mysql-test for debugging and testing of replication.", - &opt_sporadic_binlog_dump_fail, &opt_sporadic_binlog_dump_fail, 0, - GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, -<<<<<<< HEAD -#ifndef XTRABACKUP - {"ssl", OPT_USE_SSL, - "Enable SSL for connection (automatically enabled with other flags).", - &opt_use_ssl, &opt_use_ssl, nullptr, GET_BOOL, OPT_ARG, 1, 0, 0, nullptr, - 0, nullptr}, - {"admin-ssl", OPT_USE_ADMIN_SSL, - "Enable SSL for admin interface (automatically enabled with other flags).", - &opt_use_admin_ssl, &opt_use_admin_ssl, nullptr, GET_BOOL, OPT_ARG, 1, 0, - 0, nullptr, 0, nullptr}, -#endif /* XTRABACKUP */ -||||||| 824e2b40640 - {"ssl", OPT_USE_SSL, - "Enable SSL for connection (automatically enabled with other flags).", - &opt_use_ssl, &opt_use_ssl, nullptr, GET_BOOL, OPT_ARG, 1, 0, 0, nullptr, - 0, nullptr}, - {"admin-ssl", OPT_USE_ADMIN_SSL, - "Enable SSL for admin interface (automatically enabled with other flags).", - &opt_use_admin_ssl, &opt_use_admin_ssl, nullptr, GET_BOOL, OPT_ARG, 1, 0, - 0, nullptr, 0, nullptr}, -======= ->>>>>>> mysql-8.4.0 + {"sporadic-binlog-dump-fail", 0, + "Option used by mysql-test for debugging and testing of replication.", + &opt_sporadic_binlog_dump_fail, &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, + NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, #ifdef _WIN32 - {"standalone", 0, "Dummy option to start as a standalone program (NT).", - nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"no-monitor", 0, "Disable monitor process.", &opt_no_monitor, - &opt_no_monitor, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"standalone", 0, "Dummy option to start as a standalone program (NT).", + nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"no-monitor", 0, "Disable monitor process.", &opt_no_monitor, + &opt_no_monitor, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr}, #endif - {"symbolic-links", 's', - "Enable symbolic link support (deprecated and will be removed in a future" - " release).", - &my_enable_symlinks, &my_enable_symlinks, nullptr, GET_BOOL, NO_ARG, 0, 0, - 0, nullptr, 0, nullptr}, - {"sysdate-is-now", 0, - "Non-default option to alias SYSDATE() to NOW() to make it " - "safe-replicable. " - "Since 5.0, SYSDATE() returns a `dynamic' value different for different " - "invocations, even within the same statement.", - &global_system_variables.sysdate_is_now, nullptr, nullptr, GET_BOOL, - NO_ARG, 0, 0, 1, nullptr, 1, nullptr}, - {"tc-heuristic-recover", 0, - "Decision to use in heuristic recover process. Possible values are OFF, " - "COMMIT or ROLLBACK.", - &tc_heuristic_recover, &tc_heuristic_recover, - &tc_heuristic_recover_typelib, GET_ENUM, REQUIRED_ARG, - TC_HEURISTIC_NOT_USED, 0, 0, nullptr, 0, nullptr}, + {"symbolic-links", 's', + "Enable symbolic link support (deprecated and will be removed in a future" + " release).", + &my_enable_symlinks, &my_enable_symlinks, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, + nullptr, 0, nullptr}, + {"sysdate-is-now", 0, + "Non-default option to alias SYSDATE() to NOW() to make it " + "safe-replicable. " + "Since 5.0, SYSDATE() returns a `dynamic' value different for different " + "invocations, even within the same statement.", + &global_system_variables.sysdate_is_now, nullptr, nullptr, GET_BOOL, NO_ARG, + 0, 0, 1, nullptr, 1, nullptr}, + {"tc-heuristic-recover", 0, + "Decision to use in heuristic recover process. Possible values are OFF, " + "COMMIT or ROLLBACK.", + &tc_heuristic_recover, &tc_heuristic_recover, &tc_heuristic_recover_typelib, + GET_ENUM, REQUIRED_ARG, TC_HEURISTIC_NOT_USED, 0, 0, nullptr, 0, nullptr}, #if defined(ENABLED_DEBUG_SYNC) - {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT, - "Enable the debug sync facility " - "and optionally specify a default wait timeout in seconds. " - "A zero value keeps the facility disabled.", - &opt_debug_sync_timeout, nullptr, nullptr, GET_UINT, OPT_ARG, 0, 0, - UINT_MAX, nullptr, 0, nullptr}, + {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT, + "Enable the debug sync facility " + "and optionally specify a default wait timeout in seconds. " + "A zero value keeps the facility disabled.", + &opt_debug_sync_timeout, nullptr, nullptr, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, + nullptr, 0, nullptr}, #endif /* defined(ENABLED_DEBUG_SYNC) */ - {"transaction-isolation", 0, "Default transaction isolation level.", - &global_system_variables.transaction_isolation, - &global_system_variables.transaction_isolation, &tx_isolation_typelib, - GET_ENUM, REQUIRED_ARG, ISO_REPEATABLE_READ, 0, 0, nullptr, 0, nullptr}, - {"transaction-read-only", 0, - "Default transaction access mode. " - "True if transactions are read-only.", - &global_system_variables.transaction_read_only, - &global_system_variables.transaction_read_only, nullptr, GET_BOOL, OPT_ARG, - 0, 0, 0, nullptr, 0, nullptr}, - {"user", 'u', "Run mysqld daemon as user.", nullptr, nullptr, nullptr, - GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, - {"early-plugin-load", OPT_EARLY_PLUGIN_LOAD, - "Optional semicolon-separated list of plugins to load before storage " - "engine " - "initialization, where each plugin is identified as name=library, where " - "name is the plugin name and library is the plugin library in plugin_dir.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"plugin-load", OPT_PLUGIN_LOAD, - "Optional semicolon-separated list of plugins to load, where each plugin " - "is " - "identified as name=library, where name is the plugin name and library " - "is the plugin library in plugin_dir.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"plugin-load-add", OPT_PLUGIN_LOAD_ADD, - "Optional semicolon-separated list of plugins to load, where each plugin " - "is " - "identified as name=library, where name is the plugin name and library " - "is the plugin library in plugin_dir. This option adds to the list " - "specified by --plugin-load in an incremental way. " - "Multiple --plugin-load-add are supported.", - nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, - nullptr}, - {"upgrade", 0, - "Set server upgrade mode. NONE to abort server if automatic upgrade of " - "the server is needed; MINIMAL to start the server, but skip upgrade " - "steps that are not absolutely necessary; AUTO (default) to upgrade the " - "server if required; FORCE to force upgrade server.", - &opt_upgrade_mode, &opt_upgrade_mode, &upgrade_mode_typelib, GET_ENUM, - REQUIRED_ARG, UPGRADE_AUTO, 0, 0, nullptr, 0, nullptr}, - - {nullptr, 0, nullptr, nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, - 0, nullptr, 0, nullptr}}; + {"transaction-isolation", 0, "Default transaction isolation level.", + &global_system_variables.transaction_isolation, + &global_system_variables.transaction_isolation, &tx_isolation_typelib, + GET_ENUM, REQUIRED_ARG, ISO_REPEATABLE_READ, 0, 0, nullptr, 0, nullptr}, + {"transaction-read-only", 0, + "Default transaction access mode. " + "True if transactions are read-only.", + &global_system_variables.transaction_read_only, + &global_system_variables.transaction_read_only, nullptr, GET_BOOL, OPT_ARG, + 0, 0, 0, nullptr, 0, nullptr}, + {"user", 'u', "Run mysqld daemon as user.", nullptr, nullptr, nullptr, + GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr}, + {"early-plugin-load", OPT_EARLY_PLUGIN_LOAD, + "Optional semicolon-separated list of plugins to load before storage " + "engine " + "initialization, where each plugin is identified as name=library, where " + "name is the plugin name and library is the plugin library in plugin_dir.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"plugin-load", OPT_PLUGIN_LOAD, + "Optional semicolon-separated list of plugins to load, where each plugin " + "is " + "identified as name=library, where name is the plugin name and library " + "is the plugin library in plugin_dir.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"plugin-load-add", OPT_PLUGIN_LOAD_ADD, + "Optional semicolon-separated list of plugins to load, where each plugin " + "is " + "identified as name=library, where name is the plugin name and library " + "is the plugin library in plugin_dir. This option adds to the list " + "specified by --plugin-load in an incremental way. " + "Multiple --plugin-load-add are supported.", + nullptr, nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, + nullptr}, + {"upgrade", 0, + "Set server upgrade mode. NONE to abort server if automatic upgrade of " + "the server is needed; MINIMAL to start the server, but skip upgrade " + "steps that are not absolutely necessary; AUTO (default) to upgrade the " + "server if required; FORCE to force upgrade server.", + &opt_upgrade_mode, &opt_upgrade_mode, &upgrade_mode_typelib, GET_ENUM, + REQUIRED_ARG, UPGRADE_AUTO, 0, 0, nullptr, 0, nullptr}, + + {nullptr, 0, nullptr, nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, + nullptr, 0, nullptr} +}; static int show_queries(THD *thd, SHOW_VAR *var, char *) { var->type = SHOW_LONGLONG; @@ -12101,35 +12060,7 @@ bool mysqld_get_one_option(int optid, case OPT_BINLOG_EXPIRE_LOGS_SECONDS: binlog_expire_logs_seconds_supplied = true; break; -<<<<<<< HEAD #ifndef XTRABACKUP - case OPT_SSL_KEY: - case OPT_SSL_CERT: - case OPT_SSL_CA: - case OPT_SSL_CAPATH: - case OPT_SSL_CRL: - case OPT_SSL_CRLPATH: - /* - Enable use of SSL if we are using any ssl option. - One can disable SSL later by using --skip-ssl or --ssl=0. - */ - opt_use_ssl = true; - break; -||||||| 824e2b40640 - case OPT_SSL_KEY: - case OPT_SSL_CERT: - case OPT_SSL_CA: - case OPT_SSL_CAPATH: - case OPT_SSL_CRL: - case OPT_SSL_CRLPATH: - /* - Enable use of SSL if we are using any ssl option. - One can disable SSL later by using --skip-ssl or --ssl=0. - */ - opt_use_ssl = true; - break; -======= ->>>>>>> mysql-8.4.0 case OPT_TLS_CIPHERSUITES: if (validate_ciphers(opt->name, argument, TLS_version::TLSv13)) return true; diff --git a/sql/server_component/mysql_command_backend.cc b/sql/server_component/mysql_command_backend.cc index 62809e81557a..74f183ac9a16 100644 --- a/sql/server_component/mysql_command_backend.cc +++ b/sql/server_component/mysql_command_backend.cc @@ -46,6 +46,7 @@ MYSQL_METHODS mysql_methods = { csi_read_rows, csi_use_result, csi_fetch_row, csi_fetch_lengths, csi_flush_use_result, csi_read_change_user_result, #if (!defined(MYSQL_SERVER) && !defined(MYSQL_COMPONENT)) || defined(XTRABACKUP) + nullptr, // csi_list_fields, nullptr, // csi_read_prepare_result, nullptr, // csi_stmt_execute, nullptr, // csi_read_binary_rows, diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 473dad56c364..6f0f7e5b3272 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -10421,31 +10421,6 @@ bool fil_check_missing_tablespaces() { return fil_system->check_missing_tablespaces(); } -<<<<<<< HEAD -/** Parse a file name retrieved from a MLOG_FILE_* record, -and return the absolute file path and tablespace name -@param[in] file_name path emitted by the redo log -@param[in] flags tablespace flags emitted by the redo log -@param[in] space_id tablesapce ID emitted by the redo log -@param[out] absolute_path absolute path of tablespace -@param[out] tablespace_name name in the form of database/table */ -static void fil_make_abs_file_path(const char *file_name, ulint flags, - space_id_t space_id, - std::string &absolute_path, - std::string &tablespace_name) { - Datafile df; - - df.set_filepath(file_name); - df.set_flags(flags); - df.set_space_id(space_id); - df.set_name(nullptr); - - absolute_path = df.filepath(); - tablespace_name = df.name(); -} - -||||||| 824e2b40640 -======= /** Parse a path from a buffer. @param[in] ptr redo log record @param[in] end end of the redo log buffer @@ -10502,7 +10477,28 @@ const static byte *parse_path_from_redo(const byte *ptr, const byte *end, return ptr; } ->>>>>>> mysql-8.4.0 +/** Parse a file name retrieved from a MLOG_FILE_* record, +and return the absolute file path and tablespace name +@param[in] file_name path emitted by the redo log +@param[in] flags tablespace flags emitted by the redo log +@param[in] space_id tablesapce ID emitted by the redo log +@param[out] absolute_path absolute path of tablespace +@param[out] tablespace_name name in the form of database/table */ +static void fil_make_abs_file_path(const char *file_name, ulint flags, + space_id_t space_id, + std::string &absolute_path, + std::string &tablespace_name) { + Datafile df; + + df.set_filepath(file_name); + df.set_flags(flags); + df.set_space_id(space_id); + df.set_name(nullptr); + + absolute_path = df.filepath(); + tablespace_name = df.name(); +} + /** Redo a tablespace create. @param[in] ptr redo log record @param[in] end end of the redo log buffer @@ -10560,7 +10556,7 @@ const byte *fil_tablespace_redo_create(const byte *ptr, const byte *end, std::string abs_file_path; std::string tablespace_name; - fil_make_abs_file_path(name, flags, page_id.space(), abs_file_path, + fil_make_abs_file_path(name.c_str(), flags, page_id.space(), abs_file_path, tablespace_name); if (!srv_backup_mode && @@ -10607,23 +10603,10 @@ const byte *fil_tablespace_redo_create(const byte *ptr, const byte *end, return ptr; } -<<<<<<< HEAD -||||||| 824e2b40640 - /* Update filename with correct partition case, if needed. */ - std::string name_str(name); - std::string space_name; - fil_update_partition_name(page_id.space(), 0, false, space_name, name_str); - - auto abs_name = Fil_path::get_real_path(name_str); - -======= /* Update filename with correct partition case, if needed. */ std::string space_name; fil_update_partition_name(page_id.space(), 0, false, space_name, name); - auto abs_name = Fil_path::get_real_path(name); - ->>>>>>> mysql-8.4.0 /* Duplicates should have been sorted out before we get here. */ ut_a(result.second->size() == 1); @@ -10671,22 +10654,12 @@ const byte *fil_tablespace_redo_rename(const byte *ptr, const byte *end, return nullptr; } -<<<<<<< HEAD - ptr += to_len; - Fil_path::normalize(to_name); - #ifdef XTRABACKUP if (parse_only) { return ptr; } #endif /* XTRABACKUP */ -||||||| 824e2b40640 - ptr += to_len; - Fil_path::normalize(to_name); - -======= ->>>>>>> mysql-8.4.0 #ifdef UNIV_HOTBACKUP if (!parse_only) { @@ -10695,6 +10668,9 @@ const byte *fil_tablespace_redo_rename(const byte *ptr, const byte *end, #else /* !UNIV_HOTBACKUP */ + std::string space_name; + fil_update_partition_name(page_id.space(), 0, false, space_name, to_name); + if (from_name == to_name) { ib::error(ER_IB_MSG_360) << "MLOG_FILE_RENAME: The from and to name are the" @@ -10708,7 +10684,7 @@ const byte *fil_tablespace_redo_rename(const byte *ptr, const byte *end, if (!srv_backup_mode) { bool success; if (fil_tablespace_open_for_recovery(page_id.space()) != DB_SUCCESS) { - xb::info() << "Rename failed. Cannot find " << SQUOTE(from_name) << "!"; + xb::info() << "Rename failed. Cannot find " << from_name << "!"; return (ptr); } @@ -10720,10 +10696,10 @@ const byte *fil_tablespace_redo_rename(const byte *ptr, const byte *end, std::string abs_file_path; std::string tablespace_name; - fil_make_abs_file_path(to_name, space->flags, space->id, abs_file_path, - tablespace_name); + fil_make_abs_file_path(to_name.c_str(), space->flags, space->id, + abs_file_path, tablespace_name); - success = fil_op_replay_rename(page_id, from_name, to_name); + success = fil_op_replay_rename(page_id, from_name.c_str(), to_name.c_str()); ut_a(success); xb_tablespace_map_add(abs_file_path.c_str(), tablespace_name.c_str()); @@ -10949,7 +10925,7 @@ const byte *fil_tablespace_redo_delete(const byte *ptr, const byte *end, success = fil_tablespace_open_for_recovery(page_id.space()); if (!success) { - xb::info(ER_IB_MSG_356) << "Delete " << SQUOTE(name) << " failed!"; + xb::info(ER_IB_MSG_356) << "Delete " << name << " failed!"; return (ptr); } diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index 1dad51913527..895ea851a5d0 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -719,7 +719,6 @@ dberr_t Datafile::validate_first_page(space_id_t space_id, lsn_t *flush_lsn, m_encryption_op_in_progress = fsp_header_encryption_op_type_in_progress(m_first_page, page_size); #endif /* UNIV_HOTBACKUP */ -<<<<<<< HEAD if (FSP_FLAGS_GET_ENCRYPTION(m_flags) && !srv_backup_mode && use_dumped_tablespace_keys) { @@ -732,14 +731,9 @@ dberr_t Datafile::validate_first_page(space_id_t space_id, lsn_t *flush_lsn, Encryption::set_master_key(master_key_id); } } - -||||||| 824e2b40640 - -======= /* Following call will attempt to acquire a Fil_shard mutex, which can cause a deadlock if done while holding file handle open. */ ut_ad(!is_open()); ->>>>>>> mysql-8.4.0 if (fil_space_read_name_and_filepath(m_space_id, &prev_name, &prev_filepath)) { if (0 == strcmp(m_filepath, prev_filepath)) { diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 75d29c1cb447..f19e22824174 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -171,9 +171,6 @@ static constexpr os_fd_t OS_FILE_CLOSED = OS_FD_CLOSED; #endif /* _WIN32 */ -/** Umask for creating files */ -extern ulint os_innodb_umask; - /** Common file descriptor for file IO instrumentation with PFS on windows and other platforms */ struct pfs_os_file_t { diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index abfaa2ed3db9..db1800386699 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1927,21 +1927,6 @@ dberr_t log_sys_init(bool expect_no_files, lsn_t flushed_lsn, return err; } - /* Check creator of log files and mark fields of recv_sys: is_cloned_db, - is_meb_db if needed. */ -<<<<<<< HEAD - err = log_sys_handle_creator(log); - if (err != DB_SUCCESS) { - return err; - } - - if (log_file_header_check_flag(log_flags, LOG_HEADER_FLAG_NO_LOGGING)) { - auto result = mtr_t::s_logging.disable(nullptr); - /* Currently never fails. */ - ut_a(result == 0); - srv_redo_log = false; - } - #ifdef XTRABACKUP /** * Adjust xb_log_detected_format on backup. For prepare we do it at @@ -1952,24 +1937,9 @@ dberr_t log_sys_init(bool expect_no_files, lsn_t flushed_lsn, } #endif // XTRABACKUP - return DB_SUCCESS; -||||||| 824e2b40640 - err = log_sys_handle_creator(log); - if (err != DB_SUCCESS) { - return err; - } - - if (log_file_header_check_flag(log_flags, LOG_HEADER_FLAG_NO_LOGGING)) { - auto result = mtr_t::s_logging.disable(nullptr); - /* Currently never fails. */ - ut_a(result == 0); - srv_redo_log = false; - } - - return DB_SUCCESS; -======= + /* Check creator of log files and mark fields of recv_sys: is_cloned_db, + is_meb_db if needed. */ return log_sys_handle_creator(log); ->>>>>>> mysql-8.4.0 } void log_sys_close() { diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 5eeca4b937cb..66d4a2d7da8d 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -238,29 +238,6 @@ static bool recv_writer_is_active() { #ifndef UNIV_HOTBACKUP -<<<<<<< HEAD -||||||| 824e2b40640 -/** Reads a specified log segment to a buffer. -@param[in,out] log redo log -@param[in,out] buf buffer where to read -@param[in] start_lsn read area start -@param[in] end_lsn read area end -@return lsn up to which data was available on disk (ideally end_lsn) */ -static lsn_t recv_read_log_seg(log_t &log, byte *buf, lsn_t start_lsn, - lsn_t end_lsn); - -======= -/** Reads a specified log segment to a buffer. -@param[in,out] log redo log -@param[in,out] buf buffer where to read -@param[in] start_lsn read area start -@param[in] end_lsn read area end -@return lsn up to which data was available on disk (ideally end_lsn) -or zero in case of error */ -static lsn_t recv_read_log_seg(log_t &log, byte *buf, lsn_t start_lsn, - lsn_t end_lsn); - ->>>>>>> mysql-8.4.0 /** Initialize crash recovery environment. Can be called iff recv_needed_recovery == false. */ static void recv_init_crash_recovery(); @@ -1859,7 +1836,7 @@ static const byte *recv_parse_or_apply_log_rec_body( ut_ad(LSN_MAX != start_lsn); - byte *ptr_copy = ptr; + const byte *ptr_copy = ptr; ptr_copy += 2; // skip offset ulint len = mach_read_from_2(ptr_copy); ptr_copy += 2; @@ -2682,8 +2659,8 @@ static pxb_space_page *recv_get_page_map(space_id_t space_id) { * later when we run the --prepare phase. */ static void recv_calculate_hash_heap(mlog_id_t type, space_id_t space_id, - page_no_t page_no, byte *body, - byte *rec_end, lsn_t start_lsn) { + page_no_t page_no, const byte *body, + const byte *rec_end, lsn_t start_lsn) { if (!recv_recovery_on && xtrabackup_start_checkpoint > start_lsn) return; ut_ad(type != MLOG_FILE_DELETE); @@ -3932,12 +3909,6 @@ bool meb_scan_log_recs( } if (!recv_sys->found_corrupt_log) { -<<<<<<< HEAD - more_data = - recv_sys_add_to_parsing_buf(log_block, scanned_lsn, data_len); -||||||| 824e2b40640 - more_data = recv_sys_add_to_parsing_buf(log_block, scanned_lsn); -======= /* Since the recv_sys_add_to_parsing_buf is "idempotent" if the scanned_lsn is not larger than the one already processed. Therefore, it is fine to call recv_sys_add_to_parsing_buf after the @@ -3950,8 +3921,8 @@ bool meb_scan_log_recs( } #endif /* UNIV_DEBUG && HAVE_ASAN */ more_data = - recv_sys_add_to_parsing_buf(log_block, scanned_lsn) || more_data; ->>>>>>> mysql-8.4.0 + recv_sys_add_to_parsing_buf(log_block, scanned_lsn, data_len) || + more_data; } recv_sys->scanned_lsn = scanned_lsn; @@ -4108,19 +4079,11 @@ Parses and hashes the log records if new data found. an mtr which we can ignore, as it is already applied to tablespace files) until which all redo log has been -<<<<<<< HEAD - scanned -@param[in,out] to_lsn LSN to stop recovery at */ -static void recv_recovery_begin(log_t &log, const lsn_t checkpoint_lsn, - lsn_t to_lsn) { -||||||| 824e2b40640 - scanned */ -static void recv_recovery_begin(log_t &log, const lsn_t checkpoint_lsn) { -======= scanned +@param[in,out] to_lsn LSN to stop recovery at @return DB_SUCCESS if successfull */ -static dberr_t recv_recovery_begin(log_t &log, const lsn_t checkpoint_lsn) { ->>>>>>> mysql-8.4.0 +static dberr_t recv_recovery_begin(log_t &log, const lsn_t checkpoint_lsn, + lsn_t to_lsn) { mutex_enter(&recv_sys->mutex); recv_sys->len = 0; recv_sys->recovered_offset = 0; @@ -4313,7 +4276,6 @@ dberr_t recv_recovery_from_checkpoint_start(log_t &log, lsn_t flush_lsn, ut_a(checkpoint_lsn == checkpoint_header.m_checkpoint_lsn); -<<<<<<< HEAD ut_ad(to_lsn >= checkpoint_lsn); /* Read the encryption header to get the encryption information. */ @@ -4322,15 +4284,6 @@ dberr_t recv_recovery_from_checkpoint_start(log_t &log, lsn_t flush_lsn, return DB_ERROR; } -||||||| 824e2b40640 - /* Read the encryption header to get the encryption information. */ - err = log_encryption_read(log); - if (err != DB_SUCCESS) { - return DB_ERROR; - } - -======= ->>>>>>> mysql-8.4.0 /* Start reading the log from the checkpoint LSN up. */ ut_ad(RECV_SCAN_SIZE <= log.buf_size); @@ -4361,16 +4314,10 @@ dberr_t recv_recovery_from_checkpoint_start(log_t &log, lsn_t flush_lsn, } } -<<<<<<< HEAD - recv_recovery_begin(log, checkpoint_lsn, to_lsn); -||||||| 824e2b40640 - recv_recovery_begin(log, checkpoint_lsn); -======= - err = recv_recovery_begin(log, checkpoint_lsn); + err = recv_recovery_begin(log, checkpoint_lsn, to_lsn); if (err != DB_SUCCESS) { return err; } ->>>>>>> mysql-8.4.0 if (srv_read_only_mode && log.m_scanned_lsn > checkpoint_lsn) { ib::error(ER_IB_MSG_RECOVERY_IN_READ_ONLY); diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 9fa21b2426e3..ee89bdd2afcc 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -197,32 +197,12 @@ still created. See Kernel Bugzilla Bug 218049 */ } #ifndef _WIN32 -<<<<<<< HEAD -/** Umask for creating files */ -ulint os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; -||||||| 824e2b40640 -/** Umask for creating files */ -static ulint os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; -======= /** This specifies the file permissions InnoDB uses when it creates files in Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to my_umask. It is a global value and can't be modified once it is set. */ static mode_t os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; ->>>>>>> mysql-8.4.0 #else -<<<<<<< HEAD -/** Umask for creating files */ -ulint os_innodb_umask = 0; - -/* On Windows when using native AIO the number of AIO requests -||||||| 824e2b40640 -/** Umask for creating files */ -static ulint os_innodb_umask = 0; - -/* On Windows when using native AIO the number of AIO requests -======= /** On Windows when using native AIO the number of AIO requests ->>>>>>> mysql-8.4.0 that a thread can handle at a given time is limited to 32 i.e.: SRV_N_PENDING_IOS_PER_THREAD */ constexpr uint32_t SRV_N_PENDING_IOS_PER_THREAD = diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 1da90aa965b6..2268f4a07ec9 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1598,6 +1598,11 @@ static dberr_t recreate_redo_files(lsn_t &flushed_lsn) { fil_open_system_tablespace_files(); + err = log_start(*log_sys, flushed_lsn, flushed_lsn); + if (err != DB_SUCCESS) { + return err; + } + return DB_SUCCESS; } diff --git a/storage/innobase/xtrabackup/src/CMakeLists.txt b/storage/innobase/xtrabackup/src/CMakeLists.txt index d5e903e5db29..7cf66a35c674 100644 --- a/storage/innobase/xtrabackup/src/CMakeLists.txt +++ b/storage/innobase/xtrabackup/src/CMakeLists.txt @@ -71,7 +71,6 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/plugin/keyring ${BOOST_PATCHES_DIR}) -ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/plugin/keyring "${CMAKE_CURRENT_BINARY_DIR}/keyring") MY_ADD_COMPILE_DEFINITIONS( xtrabackup.cc diff --git a/storage/innobase/xtrabackup/src/backup_copy.cc b/storage/innobase/xtrabackup/src/backup_copy.cc index ee93a3664c17..bcf0696f3909 100644 --- a/storage/innobase/xtrabackup/src/backup_copy.cc +++ b/storage/innobase/xtrabackup/src/backup_copy.cc @@ -1533,7 +1533,7 @@ bool backup_finish(Backup_context &context) { if (opt_safe_slave_backup && sql_thread_started) { xb::info() << "Starting slave SQL thread"; - xb_mysql_query(mysql_connection, "START SLAVE SQL_THREAD", false); + xb_mysql_query(mysql_connection, "START REPLICA SQL_THREAD", false); } /* Copy buffer pool dump or LRU dump */ diff --git a/storage/innobase/xtrabackup/src/backup_mysql.cc b/storage/innobase/xtrabackup/src/backup_mysql.cc index 9c1a333e49b8..5d697d00e9d5 100644 --- a/storage/innobase/xtrabackup/src/backup_mysql.cc +++ b/storage/innobase/xtrabackup/src/backup_mysql.cc @@ -753,7 +753,7 @@ bool detect_mysql_capabilities_for_backup() { mysql_variable status[] = {{"Auto_Position", &auto_position}, {NULL, NULL}}; MYSQL_RES *res = - xb_mysql_query(mysql_connection, "SHOW SLAVE STATUS", true, true); + xb_mysql_query(mysql_connection, "SHOW REPLICA STATUS", true, true); slave_auto_position = true; @@ -1193,11 +1193,11 @@ static char *get_slave_coordinates(MYSQL *connection) { char *result = NULL; mysql_variable slave_coordinates[] = { - {"Relay_Master_Log_File", &relay_log_file}, - {"Exec_Master_Log_Pos", &exec_log_pos}, + {"Relay_Source_Log_File", &relay_log_file}, + {"Exec_Source_Log_Pos", &exec_log_pos}, {NULL, NULL}}; - read_mysql_variables(connection, "SHOW SLAVE STATUS", slave_coordinates, + read_mysql_variables(connection, "SHOW REPLICA STATUS", slave_coordinates, false); ut_a(asprintf(&result, "%s\\%s", relay_log_file, exec_log_pos)); free_mysql_variables(slave_coordinates); @@ -1222,13 +1222,13 @@ bool wait_for_safe_slave(MYSQL *connection) { int open_temp_tables = 0; bool result = true; - mysql_variable status[] = {{"Read_Master_Log_Pos", &read_master_log_pos}, - {"Slave_SQL_Running", &slave_sql_running}, + mysql_variable status[] = {{"Read_Source_Log_Pos", &read_master_log_pos}, + {"Replica_SQL_Running", &slave_sql_running}, {NULL, NULL}}; sql_thread_started = false; - read_mysql_variables(connection, "SHOW SLAVE STATUS", status, false); + read_mysql_variables(connection, "SHOW REPLICA STATUS", status, false); if (!(read_master_log_pos && slave_sql_running)) { xb::info() << "Not checking slave open temp tables for " @@ -1241,7 +1241,7 @@ bool wait_for_safe_slave(MYSQL *connection) { take that into account as part of total timeout. */ sql_thread_started = true; - xb_mysql_query(connection, "STOP SLAVE SQL_THREAD", false); + xb_mysql_query(connection, "STOP REPLICA SQL_THREAD", false); } retry: @@ -1259,7 +1259,7 @@ bool wait_for_safe_slave(MYSQL *connection) { prev_slave_coordinates = curr_slave_coordinates; curr_slave_coordinates = NULL; - xb_mysql_query(connection, "START SLAVE SQL_THREAD", false); + xb_mysql_query(connection, "START REPLICA SQL_THREAD", false); std::this_thread::sleep_for(std::chrono::seconds(sleep_time)); curr_slave_coordinates = get_slave_coordinates(connection); @@ -1271,7 +1271,7 @@ bool wait_for_safe_slave(MYSQL *connection) { "not stopping the SQL thread."; } else { xb::info() << "Stopping SQL thread."; - xb_mysql_query(connection, "STOP SLAVE SQL_THREAD", false); + xb_mysql_query(connection, "STOP REPLICA SQL_THREAD", false); } open_temp_tables = get_open_temp_tables(connection); @@ -1282,7 +1282,7 @@ bool wait_for_safe_slave(MYSQL *connection) { /* We are in a race here, slave might open other temp tables inbetween last check and stop. So we have to re-check and potentially retry after stopping SQL thread. */ - xb_mysql_query(connection, "STOP SLAVE SQL_THREAD", false); + xb_mysql_query(connection, "STOP REPLICA SQL_THREAD", false); open_temp_tables = get_open_temp_tables(connection); if (open_temp_tables != 0) { goto retry; @@ -1300,9 +1300,9 @@ bool wait_for_safe_slave(MYSQL *connection) { xb::info() << "Restoring SQL thread state to " << (sql_thread_started ? "STARTED" : "STOPPED"); if (sql_thread_started) { - xb_mysql_query(connection, "START SLAVE SQL_THREAD", false); + xb_mysql_query(connection, "START REPLICA SQL_THREAD", false); } else { - xb_mysql_query(connection, "STOP SLAVE SQL_THREAD", false); + xb_mysql_query(connection, "STOP REPLICA SQL_THREAD", false); } cleanup: @@ -1339,16 +1339,16 @@ bool write_slave_info(MYSQL *connection) { std::map channels; - mysql_variable status[] = {{"Master_Host", &master}, - {"Relay_Master_Log_File", &filename}, - {"Exec_Master_Log_Pos", &position}, + mysql_variable status[] = {{"Source_Host", &master}, + {"Relay_Source_Log_File", &filename}, + {"Exec_Source_Log_Pos", &position}, {"Channel_Name", &channel_name}, - {"Slave_SQL_Running", &slave_sql_running}, + {"Replica_SQL_Running", &slave_sql_running}, {"Auto_Position", &auto_position}, {NULL, NULL}}; MYSQL_RES *slave_status_res = - xb_mysql_query(connection, "SHOW SLAVE STATUS", true, true); + xb_mysql_query(connection, "SHOW REPLICA STATUS", true, true); while (read_mysql_variables_from_result(slave_status_res, status, false)) { channel_info_t info; @@ -1379,7 +1379,7 @@ bool write_slave_info(MYSQL *connection) { if (ch == channels.end()) { xb::error() << "Failed to find information for channel " << SQUOTE(channel.channel_name.c_str()) - << " in SHOW SLAVE STATUS output."; + << " in SHOW REPLICA STATUS output."; result = false; goto cleanup; } @@ -1391,8 +1391,8 @@ bool write_slave_info(MYSQL *connection) { slave_info << "SET GLOBAL gtid_purged='" << log_status.gtid_executed << "';\n"; } - slave_info << "CHANGE MASTER TO MASTER_AUTO_POSITION=1" << for_channel - << ";\n"; + slave_info << "CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=1" + << for_channel << ";\n"; mysql_slave_position_s << "master host '" << ch->second.master << "', purge list '" << log_status.gtid_executed @@ -1405,8 +1405,8 @@ bool write_slave_info(MYSQL *connection) { const auto position = channel.relay_master_log_file.empty() ? ch->second.position : channel.exec_master_log_position; - slave_info << "CHANGE MASTER TO MASTER_LOG_FILE='" << filename - << "', MASTER_LOG_POS=" << position << for_channel << ";\n"; + slave_info << "CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE='" << filename + << "', SOURCE_LOG_POS=" << position << for_channel << ";\n"; mysql_slave_position_s << "master host '" << ch->second.master << "', filename '" << filename << "', position '" @@ -1625,8 +1625,8 @@ static void log_status_replication_parse(const char *s, cs.relay_log_file = ch["relay_log_file"].GetString(); cs.relay_log_position = ch["relay_log_position"].GetUint64(); if (server_flavor == FLAVOR_PERCONA_SERVER) { - cs.relay_master_log_file = ch["relay_master_log_file"].GetString(); - cs.exec_master_log_position = ch["exec_master_log_position"].GetUint64(); + cs.relay_master_log_file = ch["relay_source_log_file"].GetString(); + cs.exec_master_log_position = ch["exec_source_log_position"].GetUint64(); } log_status.channels.push_back(cs); } diff --git a/storage/innobase/xtrabackup/src/xtrabackup.cc b/storage/innobase/xtrabackup/src/xtrabackup.cc index d40e8ce3af13..f2c404b5be1d 100644 --- a/storage/innobase/xtrabackup/src/xtrabackup.cc +++ b/storage/innobase/xtrabackup/src/xtrabackup.cc @@ -86,6 +86,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include +#include "sql/signal_handler.h" #include #include @@ -412,8 +413,6 @@ std::set param_set; static ulonglong global_max_value; -extern "C" void handle_fatal_signal(int sig); - bool opt_galera_info = false; bool opt_slave_info = false; bool opt_page_tracking = false; @@ -506,8 +505,8 @@ char xtrabackup_version_str[30] = ""; /* 8.0.20.debug| 8.0.20 */ char mysql_server_flavor[256] = ""; /* Percona|MariaDB|Oracle */ unsigned long xb_server_version; -#include "caching_sha2_passwordopt-vars.h" -#include "sslopt-vars.h" +#include "client/include/caching_sha2_passwordopt-vars.h" +#include "client/include/sslopt-vars.h" bool redo_catchup_completed = false; extern struct rand_struct sql_rand; @@ -1320,8 +1319,8 @@ struct my_option xb_client_options[] = { 10 * 1024 * 1024, 2 * UNIV_PAGE_SIZE_MAX, UINT_MAX, 0, UNIV_PAGE_SIZE_MAX, 0}, -#include "caching_sha2_passwordopt-longopts.h" -#include "sslopt-longopts.h" +#include "client/include/caching_sha2_passwordopt-longopts.h" +#include "client/include/sslopt-longopts.h" #if !defined(HAVE_YASSL) {"server-public-key-path", OPT_SERVER_PUBLIC_KEY, @@ -1959,7 +1958,7 @@ bool xb_get_one_option(int optid, const struct my_option *opt, char *argument) { xtrabackup_use_memory_set = true; break; -#include "sslopt-case.h" +#include "client/include/sslopt-case.h" case '?': usage(); @@ -2037,10 +2036,6 @@ static bool innodb_init_param(void) { } } - os_innodb_umask = (ulint)0664; - - os_file_set_umask(my_umask); - /* Setup the memory alloc/free tracing mechanisms before calling any functions that could possibly allocate memory. */ ut_new_boot(); @@ -6767,7 +6762,7 @@ static void setup_signals() #ifdef HAVE_STACKTRACE my_init_stacktrace(); #endif - sa.sa_handler = handle_fatal_signal; + sa.sa_sigaction = handle_fatal_signal; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGABRT, &sa, NULL); sigaction(SIGBUS, &sa, NULL); diff --git a/storage/innobase/xtrabackup/test/inc/common.sh b/storage/innobase/xtrabackup/test/inc/common.sh index cea3bdefd60e..da68db3ac076 100644 --- a/storage/innobase/xtrabackup/test/inc/common.sh +++ b/storage/innobase/xtrabackup/test/inc/common.sh @@ -567,7 +567,7 @@ plugin_dir=${MYSQL_BASEDIR}/lib/plugin/debug" GRANT BACKUP_ADMIN ON *.* TO rpl_user@'%'; FLUSH PRIVILEGES; SET SQL_LOG_BIN=1;" - ${MYSQL} ${MYSQL_ARGS} -e "RESET SLAVE; CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';" + ${MYSQL} ${MYSQL_ARGS} -e "RESET REPLICA; CHANGE REPLICATION SOURCE TO SOURCE_USER='rpl_user', SOURCE_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';" # Start/Bootstrap cluster if [[ ${i} -eq 1 ]]; @@ -645,9 +645,9 @@ function setup_slave() local extra="" if [ "$1" == "GTID" ] then - extra=", MASTER_AUTO_POSITION = 1" + extra=", SOURCE_AUTO_POSITION = 1" shift - echo "Setting up slave in GTID mode" + echo "Setting up replica in GTID mode" fi local use_channels=0 @@ -662,33 +662,33 @@ function setup_slave() shift switch_server $slave_id_arg - mysql -e "STOP SLAVE" + mysql -e "STOP REPLICA" while [ "$#" -ne 0 ] do local master_id_arg=$1 shift - vlog "Setting up server #$slave_id_arg as a slave of server #$master_id_arg" + vlog "Setting up server #$slave_id_arg as a replica of server #$master_id_arg" if [ "$use_channels" -eq 1 ] then local master_channel="FOR CHANNEL 'master-$master_id_arg'" fi run_cmd $MYSQL $MYSQL_ARGS <&1 | grep -q debug-sync; then skip_test "Requires --debug-sync support" @@ -10,7 +16,6 @@ then skip_test "Requires server version 5.7" fi -start_server --innodb-log-file-size=80M load_dbase_schema sakila load_dbase_data sakila mkdir $topdir/backup @@ -79,8 +84,8 @@ $MYSQL $MYSQL_ARGS -Ns -e "DROP TABLE tmp1" sakila innodb_wait_for_flush_all -run_cmd $XB_BIN $XB_ARGS --innodb-log-file-size=80M --xtrabackup-plugin-dir=${plugin_dir} --lock-ddl=false --backup \ ---target-dir=$topdir/backup --debug-sync="xtrabackup_pause_after_redo_catchup" & +run_cmd $XB_BIN $XB_ARGS --innodb-log-file-size=80M --lock-ddl=false --backup \ +--target-dir=$topdir/backup --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} --debug-sync="xtrabackup_pause_after_redo_catchup" & job_pid=$! @@ -108,15 +113,17 @@ kill -SIGCONT $xb_pid run_cmd wait $job_pid # prepare backup -run_cmd $XB_BIN $XB_ARGS --xtrabackup-plugin-dir=${plugin_dir} --prepare \ ---target-dir=$topdir/backup ${keyring_args} +run_cmd $XB_BIN $XB_ARGS --prepare \ +--target-dir=$topdir/backup --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} # restore stop_server rm -rf $mysql_datadir - xtrabackup --copy-back --target-dir=$topdir/backup +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir + start_server --innodb-log-file-size=80M run_cmd $MYSQL $MYSQL_ARGS -Ns -e "SELECT * FROM tmp2;" sakila diff --git a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1879.sh b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1879.sh index 38ba46372977..574440a88d20 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1879.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1879.sh @@ -4,9 +4,11 @@ require_server_version_higher_than 5.7.10 +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh +configure_server_with_component -start_server load_sakila diff --git a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1903.sh b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1903.sh index 3fa9e7db33d2..83b777b4062c 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1903.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1903.sh @@ -4,9 +4,10 @@ require_server_version_higher_than 5.7.10 +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh - -start_server +configure_server_with_component mysql -e "CREATE TABLE t (a INT) ENCRYPTION='y'" test diff --git a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1936.sh b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1936.sh index 55f39a6e1849..b6e32357ac7c 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1936.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1936.sh @@ -4,9 +4,10 @@ require_server_version_higher_than 5.7.10 +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh - -start_server +configure_server_with_component mysql -e "CREATE TABLE t (a INT) ENCRYPTION='y'" test @@ -22,12 +23,16 @@ xtrabackup --backup --target-dir=$topdir/backup stop_server -run_cmd_expect_failure $XB_BIN $XB_ARGS --prepare --target-dir=$topdir/backup +run_cmd_expect_failure $XB_BIN $XB_ARGS --prepare --target-dir=$topdir/backup > $topdir/pxb_prepare_fail.log 2>&1 +vlog "Destroying data: $MYSQLD_DATADIR" rm -rf $mysql_datadir +vlog "Data destroyed" +vlog "Destroying backup: $topdir/backup" rm -rf $topdir/backup +vlog "Backup destroyed" -start_server +configure_server_with_component mysql -e "CREATE TABLE t (a INT) ENCRYPTION='y'" test diff --git a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1937.sh b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1937.sh index 38d33ee2f498..899900066507 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1937.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1937.sh @@ -7,9 +7,11 @@ binlog-encryption log-bin=binlog " +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh +configure_server_with_component -start_server xtrabackup --backup --target-dir=$topdir/backup --transition-key=123 @@ -26,4 +28,7 @@ xtrabackup --no-defaults --datadir=$mysql_datadir \ --xtrabackup-plugin-dir=${plugin_dir} \ ${keyring_args} +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir + start_server diff --git a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh index 3e536b7e0984..bc4bd42bd406 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh @@ -2,9 +2,10 @@ # PXB-1954: PXB gets stuck in prepare of full backup for encrypted tablespace # +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh - -start_server +configure_server_with_component mysql test </dev/null >/dev/null innodb_wait_for_flush_all @@ -20,12 +22,15 @@ xtrabackup --backup --target-dir=$topdir/backup stop_server -xtrabackup --prepare --target-dir=$topdir/backup +xtrabackup --prepare --target-dir=$topdir/backup --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} rm -rf $mysql_datadir xtrabackup --copy-back --target-dir=$topdir/backup +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir + start_server if mysql -e "select encryption from information_schema.INNODB_TABLESPACES where name='ts'" test | grep Y ; then diff --git a/storage/innobase/xtrabackup/test/suites/keyring/reencrypt.sh b/storage/innobase/xtrabackup/test/suites/keyring/reencrypt.sh index 31f352dee1b8..3a92c6f52a95 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/reencrypt.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/reencrypt.sh @@ -4,9 +4,11 @@ require_server_version_higher_than 5.7.10 +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh +configure_server_with_component -start_server --early-plugin-load=keyring_file.so --keyring-file-data=$keyring_file_plugin --server_id=10 run_cmd $MYSQL $MYSQL_ARGS test < $mysql_datadir/auto.cnf < $topdir/pxb_prepare_fail.log 2>&1 -egrep -q "Encryption information in datafile: ./test/t.ibd can't be decrypted, please confirm that keyring is loaded" $topdir/pxb_prepare_fail.log || die "xtrabackup prepare didn't fail without keyring" +egrep -q "Encryption can't find master key, please check the keyring is loaded." $topdir/pxb_prepare_fail.log || die "xtrabackup prepare didn't fail without keyring" vlog "Prepare the backup with keyring" xtrabackup --prepare --target-dir=$topdir/backup \ @@ -59,6 +62,10 @@ vlog "Restore" stop_server rm -rf $MYSQLD_DATADIR/* xtrabackup --move-back --target-dir=${topdir}/backup + +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir + start_server verify_db_state test @@ -72,14 +79,26 @@ xtrabackup --lock-ddl --backup --target-dir=$topdir/backup \ vlog "Record db state" record_db_state test +stop_server + +mv $mysql_datadir/*.cnf $topdir/tmp/ +mv $mysql_datadir/*.my $topdir/tmp/ + vlog "Prepare the backup without keyring. xtrabackup should NOT fail.No redo or undo on encrypted table" vlog "We dont pass ${plugin_dir} and ${keyring_args} intentionally here" xtrabackup --prepare --target-dir=$topdir/backup 2>&1 | tee $topdir/pxb_prepare2.log +mv $topdir/tmp/*.cnf $mysql_datadir/ +mv $topdir/tmp/*.my $mysql_datadir/ + vlog "Restore" -stop_server + rm -rf $MYSQLD_DATADIR/* xtrabackup --move-back --target-dir=${topdir}/backup + +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir + start_server verify_db_state test rm $topdir/pxb_prepare.log diff --git a/storage/innobase/xtrabackup/test/suites/keyring/system_tablespace_encryption.sh b/storage/innobase/xtrabackup/test/suites/keyring/system_tablespace_encryption.sh index bbb1d2a787c0..65320bc60b6f 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/system_tablespace_encryption.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/system_tablespace_encryption.sh @@ -4,9 +4,10 @@ require_server_version_higher_than 8.0.15 +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh - -start_server +configure_server_with_component mysql -e "ALTER TABLESPACE mysql ENCRYPTION='y'" @@ -26,7 +27,11 @@ stop_server rm -rf $mysql_datadir -xtrabackup --copy-back --transition-key=1234 --generate-new-master-key --target-dir=$topdir/backup +xtrabackup --copy-back --transition-key=1234 --generate-new-master-key --target-dir=$topdir/backup \ + --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} + +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir start_server @@ -45,7 +50,10 @@ stop_server rm -rf $mysql_datadir -xtrabackup --copy-back --target-dir=$topdir/backup +xtrabackup --copy-back --target-dir=$topdir/backup --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} + +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir start_server diff --git a/storage/innobase/xtrabackup/test/suites/keyring/xb_log_archiving_encrypt.sh b/storage/innobase/xtrabackup/test/suites/keyring/xb_log_archiving_encrypt.sh index 9d96171af9d5..16ae5fd8651a 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/xb_log_archiving_encrypt.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/xb_log_archiving_encrypt.sh @@ -9,8 +9,9 @@ MYSQLD_EXTRA_MY_CNF_OPTS=" innodb_redo_log_encrypt " +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh - -start_server +configure_server_with_component . inc/xb_log_archiving.sh diff --git a/storage/innobase/xtrabackup/test/suites/pagetracking/encryption_after_checkpoint.sh b/storage/innobase/xtrabackup/test/suites/pagetracking/encryption_after_checkpoint.sh index 7aff81692dbd..1a7c645c6874 100644 --- a/storage/innobase/xtrabackup/test/suites/pagetracking/encryption_after_checkpoint.sh +++ b/storage/innobase/xtrabackup/test/suites/pagetracking/encryption_after_checkpoint.sh @@ -3,12 +3,13 @@ ############################################################################ . inc/common.sh +KEYRING_TYPE="component" +. inc/keyring_common.sh . inc/keyring_file.sh +configure_server_with_component require_debug_server -start_server - vlog "take incremental backup" mysql test <>>>>>> mysql-8.4.0 MYSQL_ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.cc SKIP_INSTALL LINK_LIBRARIES myisam_library) diff --git a/unittest/gunit/keyring/CMakeLists.txt b/unittest/gunit/keyring/CMakeLists.txt deleted file mode 100644 index a1b32770ad54..000000000000 --- a/unittest/gunit/keyring/CMakeLists.txt +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (c) 2013, 2023, Oracle and/or its affiliates. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License, version 2.0, -# as published by the Free Software Foundation. -# -# This program is also distributed with certain software (including -# but not limited to OpenSSL) that is licensed under separate terms, -# as designated in a particular file or component or in included license -# documentation. The authors of MySQL hereby grant you an additional -# permission to link the program and your derivative works with the -# separately licensed software that they have included with MySQL. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License, version 2.0, for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -SET(TESTS - keyring-api - buffered_file_io - converter - file_io -) - -ADD_DEFINITIONS(-DLOG_COMPONENT_TAG="keyring_file_tests") - -SET(ALL_KEYRING_TESTS) -FOREACH(test ${TESTS}) - LIST(APPEND ALL_KEYRING_TESTS ${test}-t.cc) -ENDFOREACH() - - -SET(SRC_FILES) -LIST(APPEND SRC_FILES - ${CMAKE_SOURCE_DIR}/plugin/keyring/common/keyring_key.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/common/keys_container.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/common/keys_iterator.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/common/keyring_impl.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/buffered_file_io.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/converter.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/buffer.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/hash_to_buffer_serializer.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/digest.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/file_io.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker_factory.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker_ver_1_0.cc - ${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker_ver_2_0.cc - ${CMAKE_SOURCE_DIR}/unittest/gunit/keyring/buffered_file_io_10.cc - ${CMAKE_SOURCE_DIR}/unittest/gunit/keyring/psi_memory_key.cc - ) - -ADD_STATIC_LIBRARY(keyring_test ${SRC_FILES} LINK_LIBRARIES ext::zlib) -ADD_DEPENDENCIES(keyring_test GenError) - -MYSQL_ADD_EXECUTABLE(merge_keyring_file_tests-t - ${ALL_KEYRING_TESTS} - ENABLE_EXPORTS - ADD_TEST merge_keyring_file_tests) - -TARGET_LINK_LIBRARIES(merge_keyring_file_tests-t - keyring_test - gunit_large - server_unittest_library - ) - -ADD_DEPENDENCIES(merge_keyring_file_tests-t GenError) - -FOREACH(test ${TESTS}) - MYSQL_ADD_EXECUTABLE(${test}-t ${test}-t.cc - ENABLE_EXPORTS SKIP_INSTALL EXCLUDE_FROM_ALL) - - TARGET_LINK_LIBRARIES(${test}-t - keyring_test - gunit_large - server_unittest_library - ) -ENDFOREACH() - diff --git a/unittest/gunit/keyring/keyring-api-t.cc b/unittest/gunit/keyring/keyring-api-t.cc deleted file mode 100644 index 6f87e3a9c02e..000000000000 --- a/unittest/gunit/keyring/keyring-api-t.cc +++ /dev/null @@ -1,460 +0,0 @@ -/* Copyright (c) 2016, 2023, Oracle and/or its affiliates. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2.0, - as published by the Free Software Foundation. - - This program is also distributed with certain software (including - but not limited to OpenSSL) that is licensed under separate terms, - as designated in a particular file or component or in included license - documentation. The authors of MySQL hereby grant you an additional - permission to link the program and your derivative works with the - separately licensed software that they have included with MySQL. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License, version 2.0, for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -#include -#include - -#include "lex_string.h" -#include "my_inttypes.h" -#include "plugin/keyring/common/keyring_impl.cc" -#include "plugin/keyring/keyring.cc" -#include "sql/sql_plugin_ref.h" -#include "unittest/gunit/keyring/mock_logger.h" - -namespace keyring__api_unittest { -using ::testing::StrEq; -using namespace keyring; - -class Keyring_api_test : public ::testing::Test { - public: - Keyring_api_test() = default; - ~Keyring_api_test() override { - delete[] plugin_name; - delete[] keyring_filename; - } - - protected: - void SetUp() override { - plugin_name = new char[strlen("FakeKeyring") + 1]; - strcpy(plugin_name, "FakeKeyring"); - keyring_filename = new char[strlen("./keyring") + 1]; - strcpy(keyring_filename, "./keyring"); - - plugin_info.name.str = plugin_name; - plugin_info.name.length = strlen(plugin_name); - keyring_file_data_value = keyring_filename; - - remove(keyring_file_data_value); - remove("./keyring.backup"); - - keyring_init_with_mock_logger(); - - key_memory_KEYRING = PSI_NOT_INSTRUMENTED; - key_LOCK_keyring = PSI_NOT_INSTRUMENTED; - sample_key_data = "Robi"; - } - void TearDown() override { - keyring_deinit_with_mock_logger(); - remove(keyring_file_data_value); - remove("./keyring.backup"); - } - - protected: - void keyring_init_with_mock_logger(); - void keyring_deinit_with_mock_logger(); - - std::string sample_key_data; - char *plugin_name; - char *keyring_filename; - st_plugin_int plugin_info; // for Logger initialization -}; - -void Keyring_api_test::keyring_init_with_mock_logger() { - ASSERT_TRUE(keyring_init(&plugin_info) == 0); - // use MockLogger instead of Logger - logger.reset(new Mock_logger()); -} - -void Keyring_api_test::keyring_deinit_with_mock_logger() { - keyring_deinit(nullptr); -} - -TEST_F(Keyring_api_test, StoreFetchRemove) { - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - char *key_type; - size_t key_len; - void *key; - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, sample_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, sample_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - EXPECT_EQ(mysql_key_remove("Robert_key", "Robert"), 0); - // make sure the key was removed - fetch it - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); -} - -TEST_F(Keyring_api_test, CheckIfInmemoryKeyIsXORed) { - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - - Key key_id("Robert_key", nullptr, "Robert", nullptr, 0); - IKey *fetched_key = keys->fetch_key(&key_id); - ASSERT_TRUE(fetched_key != nullptr); - std::string expected_key_signature = "Robert_keyRobert"; - EXPECT_STREQ(fetched_key->get_key_signature()->c_str(), - expected_key_signature.c_str()); - EXPECT_EQ(fetched_key->get_key_signature()->length(), - expected_key_signature.length()); - uchar *key_data_fetched = fetched_key->get_key_data(); - size_t key_data_fetched_size = fetched_key->get_key_data_size(); - EXPECT_STREQ("AES", fetched_key->get_key_type_as_string()->c_str()); - - // make sure that the key was xored before it was put into keys_container, - // i.e. the fetched key data is not equal to the key data that was stored - EXPECT_STRNE(sample_key_data.c_str(), - reinterpret_cast(key_data_fetched)); - ASSERT_TRUE(sample_key_data.length() + 1 == key_data_fetched_size); - - // now xor to get the data that was stored - fetched_key->xor_data(); - EXPECT_STREQ(sample_key_data.c_str(), - reinterpret_cast(key_data_fetched)); - ASSERT_TRUE(sample_key_data.length() + 1 == key_data_fetched_size); - my_free(fetched_key->release_key_data()); -} - -TEST_F(Keyring_api_test, FetchNotExisting) { - char *key_type = nullptr; - void *key = nullptr; - size_t key_len = 0; - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); -} - -TEST_F(Keyring_api_test, RemoveNotExisting) { - EXPECT_EQ(mysql_key_remove("Robert_key", "Robert"), 1); -} - -TEST_F(Keyring_api_test, StoreFetchNotExisting) { - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - char *key_type; - size_t key_len; - void *key; - EXPECT_EQ(mysql_key_fetch("NotExisting", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); -} - -TEST_F(Keyring_api_test, StoreStoreStoreFetchRemove) { - std::string key_data1("Robi1"); - std::string key_data2("Robi2"); - - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - EXPECT_EQ(mysql_key_store("Robert_key1", "AES", "Robert", key_data1.c_str(), - key_data1.length() + 1), - 0); - EXPECT_EQ(mysql_key_store("Robert_key2", "AES", "Robert", key_data2.c_str(), - key_data2.length() + 1), - 0); - char *key_type; - size_t key_len; - void *key; - EXPECT_EQ(mysql_key_fetch("Robert_key1", &key_type, "Robert", &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, key_data1.length() + 1); - ASSERT_TRUE(memcmp((char *)key, key_data1.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - EXPECT_EQ(mysql_key_remove("Robert_key2", "Robert"), 0); - // make sure the key was removed - fetch it - EXPECT_EQ(mysql_key_fetch("Robert_key2", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); -} - -TEST_F(Keyring_api_test, StoreValidTypes) { - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - EXPECT_EQ( - mysql_key_store("Robert_key3", "RSA", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - EXPECT_EQ( - mysql_key_store("Robert_key4", "DSA", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); -} - -TEST_F(Keyring_api_test, StoreInvalidType) { - EXPECT_CALL( - *((Mock_logger *)logger.get()), - log(ERROR_LEVEL, StrEq("Error while storing key: invalid key_type"))); - EXPECT_EQ( - mysql_key_store("Robert_key", "YYY", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 1); - char *key_type; - size_t key_len; - void *key; - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); -} - -TEST_F(Keyring_api_test, StoreTwiceTheSameDifferentTypes) { - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - EXPECT_EQ( - mysql_key_store("Robert_key", "RSA", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 1); -} - -TEST_F(Keyring_api_test, InitWithDifferentKeyringFile) { - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - char *key_type; - size_t key_len; - void *key; - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, sample_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, sample_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - delete[] keyring_filename; - keyring_filename = new char[strlen("./new_keyring") + 1]; - strcpy(keyring_filename, "./new_keyring"); - remove(keyring_filename); - keyring_file_data_value = keyring_filename; - keyring_deinit_with_mock_logger(); - keyring_init_with_mock_logger(); - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); - EXPECT_EQ( - mysql_key_store("Robert_key_new", "AES", "Robert", - sample_key_data.c_str(), sample_key_data.length() + 1), - 0); - delete[] keyring_filename; - keyring_filename = new char[strlen("./keyring") + 1]; - strcpy(keyring_filename, "./keyring"); - keyring_file_data_value = keyring_filename; - keyring_deinit_with_mock_logger(); - keyring_init_with_mock_logger(); - EXPECT_EQ( - mysql_key_fetch("Robert_key_new", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, sample_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, sample_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - delete[] keyring_filename; - keyring_filename = new char[strlen("./new_keyring") + 1]; - strcpy(keyring_filename, "./new_keyring"); - keyring_file_data_value = keyring_filename; - keyring_deinit_with_mock_logger(); - keyring_init_with_mock_logger(); - EXPECT_EQ( - mysql_key_fetch("Robert_key_new", &key_type, "Robert", &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, sample_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, sample_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - remove("./new_keyring"); -} - -TEST_F(Keyring_api_test, NullUser) { - EXPECT_EQ( - mysql_key_store("Robert_key", "AES", nullptr, sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - char *key_type; - size_t key_len; - void *key; - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, nullptr, &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, sample_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, sample_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - EXPECT_EQ( - mysql_key_store("Robert_key", "RSA", nullptr, sample_key_data.c_str(), - sample_key_data.length() + 1), - 1); - EXPECT_EQ( - mysql_key_store("Kamil_key", "AES", nullptr, sample_key_data.c_str(), - sample_key_data.length() + 1), - 0); - EXPECT_EQ(mysql_key_fetch("Kamil_key", &key_type, nullptr, &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, sample_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, sample_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - std::string arturs_key_data = "Artur"; - EXPECT_EQ( - mysql_key_store("Artur_key", "AES", "Artur", arturs_key_data.c_str(), - arturs_key_data.length() + 1), - 0); - EXPECT_EQ(mysql_key_fetch("Artur_key", &key_type, "Artur", &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, arturs_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, arturs_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; - EXPECT_EQ(mysql_key_remove("Robert_key", nullptr), 0); - EXPECT_EQ(mysql_key_fetch("Robert_key", &key_type, "Robert", &key, &key_len), - 0); - ASSERT_TRUE(key == nullptr); - EXPECT_EQ(mysql_key_fetch("Artur_key", &key_type, "Artur", &key, &key_len), - 0); - EXPECT_STREQ("AES", key_type); - EXPECT_EQ(key_len, arturs_key_data.length() + 1); - ASSERT_TRUE(memcmp((char *)key, arturs_key_data.c_str(), key_len) == 0); - my_free(key_type); - key_type = nullptr; - my_free(key); - key = nullptr; -} - -TEST_F(Keyring_api_test, NullKeyId) { - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while storing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_store(nullptr, "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while storing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_store(nullptr, "AES", nullptr, sample_key_data.c_str(), - sample_key_data.length() + 1), - 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while storing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_store("", "AES", "Robert", sample_key_data.c_str(), - sample_key_data.length() + 1), - 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while storing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_store("", "AES", nullptr, sample_key_data.c_str(), - sample_key_data.length() + 1), - 1); - char *key_type; - size_t key_len; - void *key; - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while fetching key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_fetch(nullptr, &key_type, "Robert", &key, &key_len), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while fetching key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_fetch(nullptr, &key_type, nullptr, &key, &key_len), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while fetching key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_fetch("", &key_type, "Robert", &key, &key_len), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while fetching key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_fetch("", &key_type, nullptr, &key, &key_len), 1); - - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while removing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_remove(nullptr, "Robert"), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while removing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_remove(nullptr, nullptr), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while removing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_remove("", "Robert"), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while removing key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_remove("", nullptr), 1); - - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while generating key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_generate(nullptr, "AES", "Robert", 128), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while generating key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_generate(nullptr, "AES", nullptr, 128), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while generating key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_generate("", "AES", "Robert", 128), 1); - EXPECT_CALL(*((Mock_logger *)logger.get()), - log(ERROR_LEVEL, - StrEq("Error while generating key: key_id cannot be empty"))); - EXPECT_EQ(mysql_key_generate("", "AES", nullptr, 128), 1); -} - -} // namespace keyring__api_unittest diff --git a/utilities/CMakeLists.txt b/utilities/CMakeLists.txt index 83b6d4c1b90a..f8fc07725e74 100644 --- a/utilities/CMakeLists.txt +++ b/utilities/CMakeLists.txt @@ -135,38 +135,6 @@ MYSQL_ADD_EXECUTABLE(perror LINK_LIBRARIES mysys SKIP_INSTALL ) -<<<<<<< HEAD -IF(WITH_LZ4 STREQUAL "bundled") - MYSQL_ADD_EXECUTABLE(lz4_decompress - lz4_decompress.cc - COMPONENT Server - LINK_LIBRARIES ext::lz4 mysys - SKIP_INSTALL - ) -ENDIF() - -MYSQL_ADD_EXECUTABLE(zlib_decompress - zlib_decompress.cc - COMPONENT Server - LINK_LIBRARIES ext::zlib mysys - SKIP_INSTALL - ) -||||||| 824e2b40640 -IF(WITH_LZ4 STREQUAL "bundled") - MYSQL_ADD_EXECUTABLE(lz4_decompress - lz4_decompress.cc - COMPONENT Server - LINK_LIBRARIES ext::lz4 mysys - ) -ENDIF() - -MYSQL_ADD_EXECUTABLE(zlib_decompress - zlib_decompress.cc - COMPONENT Server - LINK_LIBRARIES ext::zlib mysys - ) -======= ->>>>>>> mysql-8.4.0 # All targets below belong to COMPONENT Server and depend on InnoDB. IF(WITHOUT_SERVER)