FreeBSD Bugzilla – Attachment 252616 Details for
Bug 280694
databases/mysql81-server: fix build with libc++ 19
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
databases/mysql81-client: fix build with libc++ 19
databases__mysql81-client-fix-libcxx19-build-1.diff (text/plain), 5.04 KB, created by
Dimitry Andric
on 2024-08-08 18:25:57 UTC
(
hide
)
Description:
databases/mysql81-client: fix build with libc++ 19
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2024-08-08 18:25:57 UTC
Size:
5.04 KB
patch
obsolete
>commit 7d4f7fc49dbbf87e2e4f7b42f903dcddc001ebe2 >Author: Dimitry Andric <dim@FreeBSD.org> >Date: 2024-08-08T10:23:23+02:00 > > databases/mysql81-client: fix build with libc++ 19 > > As noted in the libc++ 19 release notes [1], std::char_traits<> is now > only provided for char, char8_t, char16_t, char32_t and wchar_t, and any > instantiation for other types will fail. > > This causes databases/mysql81-server to fail to compile with clang 19 > and libc++ 19, resulting in errors similar to: > > /usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>' > 820 | static_assert(is_same<_CharT, typename traits_type::char_type>::value, > | ^ > /wrkdirs/usr/ports/databases/mysql81-client/work/mysql-8.1.0/sql/rpl_log_encryption.h:820:14: note: in instantiation of template class 'std::basic_string<unsigned char>' requested here > 820 | Key_string m_encrypted_password; > | ^ > /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here > 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; > | ^ > > `Key_string` is defined as `std::basic_string<unsigned char>`, which is > no longer possible. So redefine it as a `std::vector<unsigned char>` > instead. > > This requires only a few small adjustments in other places: replacing > the `length()` method with the equivalent `size()` method, and adjusting > the arguments for the `assign()` method, which for `std::vector` takes a > begin and end iterator, instead of a begin iterator and a size. > > [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals > >diff --git a/databases/mysql81-server/files/patch-sql_rpl__log__encryption.cc b/databases/mysql81-server/files/patch-sql_rpl__log__encryption.cc >new file mode 100644 >index 000000000000..78eaeed60b02 >--- /dev/null >+++ b/databases/mysql81-server/files/patch-sql_rpl__log__encryption.cc >@@ -0,0 +1,33 @@ >+--- sql/rpl_log_encryption.cc.orig 2023-06-21 07:52:10 UTC >++++ sql/rpl_log_encryption.cc >+@@ -1050,12 +1050,12 @@ bool Rpl_encryption_header_v1::serialize(Basic_ostream >+ >+ assert(m_encrypted_password.length() == PASSWORD_FIELD_SIZE); >+ *ptr++ = ENCRYPTED_FILE_PASSWORD; >+- memcpy(ptr, m_encrypted_password.data(), m_encrypted_password.length()); >++ memcpy(ptr, m_encrypted_password.data(), m_encrypted_password.size()); >+ ptr += PASSWORD_FIELD_SIZE; >+ >+ assert(m_iv.length() == IV_FIELD_SIZE); >+ *ptr++ = IV_FOR_FILE_PASSWORD; >+- memcpy(ptr, m_iv.data(), m_iv.length()); >++ memcpy(ptr, m_iv.data(), m_iv.size()); >+ >+ bool res = DBUG_EVALUATE_IF("fail_to_serialize_encryption_header", true, >+ ostream->write(header, HEADER_SIZE)); >+@@ -1110,13 +1110,13 @@ bool Rpl_encryption_header_v1::deserialize(Basic_istre >+ reinterpret_cast<const unsigned char *>( >+ reader.ptr(PASSWORD_FIELD_SIZE)); >+ if (!reader.has_error()) >+- m_encrypted_password.assign(password_ptr, PASSWORD_FIELD_SIZE); >++ m_encrypted_password.assign(password_ptr, password_ptr + PASSWORD_FIELD_SIZE); >+ break; >+ } >+ case IV_FOR_FILE_PASSWORD: { >+ const unsigned char *iv_ptr = >+ reinterpret_cast<const unsigned char *>(reader.ptr(IV_FIELD_SIZE)); >+- if (!reader.has_error()) m_iv.assign(iv_ptr, IV_FIELD_SIZE); >++ if (!reader.has_error()) m_iv.assign(iv_ptr, iv_ptr + IV_FIELD_SIZE); >+ break; >+ } >+ default: >diff --git a/databases/mysql81-server/files/patch-sql_stream__cipher.cc b/databases/mysql81-server/files/patch-sql_stream__cipher.cc >new file mode 100644 >index 000000000000..35623caf4090 >--- /dev/null >+++ b/databases/mysql81-server/files/patch-sql_stream__cipher.cc >@@ -0,0 +1,11 @@ >+--- sql/stream_cipher.cc.orig 2023-06-21 07:52:10 UTC >++++ sql/stream_cipher.cc >+@@ -45,7 +45,7 @@ bool Aes_ctr_cipher<TYPE>::open(const Key_string &pass >+ m_header_size = header_size; >+ #ifdef HAVE_BYTESTOKEY_SHA512_HANDLING >+ if (EVP_BytesToKey(Aes_ctr::get_evp_cipher(), Aes_ctr::get_evp_md(), nullptr, >+- password.data(), password.length(), 1, m_file_key, >++ password.data(), password.size(), 1, m_file_key, >+ m_iv) == 0) >+ return true; >+ #else >diff --git a/databases/mysql81-server/files/patch-sql_stream__cipher.h b/databases/mysql81-server/files/patch-sql_stream__cipher.h >new file mode 100644 >index 000000000000..9c312ac55050 >--- /dev/null >+++ b/databases/mysql81-server/files/patch-sql_stream__cipher.h >@@ -0,0 +1,20 @@ >+--- sql/stream_cipher.h.orig 2023-06-21 07:52:10 UTC >++++ sql/stream_cipher.h >+@@ -25,7 +25,7 @@ >+ >+ #include <openssl/evp.h> >+ #include <memory> >+-#include <string> >++#include <vector> >+ >+ /** >+ @file stream_cipher.h >+@@ -34,7 +34,7 @@ >+ binary log files. >+ */ >+ >+-typedef std::basic_string<unsigned char> Key_string; >++typedef std::vector<unsigned char> Key_string; >+ >+ /** >+ @class Stream_cipher
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 280694
:
252616
|
252896
|
253006
|
253093