Skip to content

Commit

Permalink
fix broken MySQL 8.1.0 build on macos-14 (#1133)
Browse files Browse the repository at this point in the history
* apply patch: Bug#35137978: Equality operator needs to be updated after LWG-3865
  • Loading branch information
shogo82148 authored Aug 31, 2024
1 parent 467898c commit fc49b8d
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions patches/mysql/8.1.0/equality-operator-needs-to-be-updated.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
commit d4ecf88abba64baa56c2528fd1aa294c6fdbad24
Author: Georgi Kodinov <georgi.kodinov@oracle.com>
Date: Thu Jul 20 14:49:31 2023 +0200

Bug#35137978: Equality operator needs to be updated after LWG-3865

The C++ Standardization Committee's Library Working Group recently resolved
an issue, LWG-3865 "Sorting a range of pairs" (see
https://cplusplus.github.io/LWG/issue3865 ), which changes how std::pair's
comparison operators are defined. Such issues are considered "defect reports"
and apply retroactively to all published Standards.

Based on a suggestion by the Microsoft Visual Studio team.

Change-Id: I8ac997fecfab9b53b4c3bdebd9ab995316aab6b7

diff --git a/sql/auth/auth_internal.h b/sql/auth/auth_internal.h
index 2b1cf5324b4..324d0332d57 100644
--- a/sql/auth/auth_internal.h
+++ b/sql/auth/auth_internal.h
@@ -255,7 +255,7 @@ void revoke_dynamic_privileges_from_auth_id(
const Role_id &id, const std::vector<std::string> &priv_list);
bool operator==(const Role_id &a, const Auth_id_ref &b);
bool operator==(const Auth_id_ref &a, const Role_id &b);
-bool operator==(const std::pair<const Role_id, const Role_id> &a,
+bool operator==(const std::pair<const Role_id, Role_id> &a,
const Auth_id_ref &b);
bool operator==(const Role_id &a, const Role_id &b);
bool operator==(std::pair<const Role_id, std::pair<std::string, bool>> &a,
diff --git a/sql/auth/sql_authorization.cc b/sql/auth/sql_authorization.cc
index 96371df9b59..71d952303ce 100644
--- a/sql/auth/sql_authorization.cc
+++ b/sql/auth/sql_authorization.cc
@@ -7437,7 +7437,7 @@ bool operator==(const Role_id &a, const Auth_id_ref &b) {

bool operator==(const Auth_id_ref &a, const Role_id &b) { return b == a; }

-bool operator==(const std::pair<const Role_id, const Role_id> &a,
+bool operator==(const std::pair<const Role_id, Role_id> &a,
const Auth_id_ref &b) {
return ((a.second.user().length() == b.first.length) &&
(a.second.host().length() == b.second.length) &&

0 comments on commit fc49b8d

Please sign in to comment.