Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37380021
en ru br
Репозитории ALT
S:8.0.30-alt2
5.1: 5.0.89-alt1
4.1: 5.0.51-alt2.a
4.0: 5.0.51-alt2.a.M40.2
+updates:5.0.51-alt2.a.M40.1
3.0: 4.0.24-alt1
www.altlinux.org/Changes

Группа :: Базы Данных
Пакет: MySQL

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: mysql-8.0.30-alt-upstream-gcc13.patch
Скачать


From e5d54bc2839865710618e7dd18f8b183ba369446 Mon Sep 17 00:00:00 2001
From: Tor Didriksen <tor.didriksen@oracle.com>
Date: Tue, 14 Jun 2022 13:19:12 +0200
Subject: [PATCH 1/2] Bug #34278103 Compile MySQL with GCC 13 [noclose]
Add some missing #includes, notably <cstdint>.
Silence a new warning for ndbcluster kernel.
/opt/gcc-latest/bin/g++ --version
g++ (GCC) 13.0.0 20220605 (experimental)
Change-Id: I13cc38babfab98251ff0e8fd7568f9cf0dcbc868
(cherry picked from commit acdcb60c731bfe95be11ac287b764eebc844e86f)
---
 libbinlogevents/include/gtids/global.h                        | 3 ++-
 libbinlogevents/include/gtids/gtidset.h                       | 1 +
 .../include/mysql/gcs/gcs_group_management_interface.h        | 2 ++
 .../libmysqlgcs/include/mysql/gcs/gcs_logging.h               | 1 +
 plugin/x/src/interface/document_id_generator.h                | 1 +
 router/src/harness/include/mysql/harness/tty.h                | 1 +
 router/src/harness/include/mysql/harness/vt100.h              | 1 +
 router/src/http/src/base64.h                                  | 1 +
 router/src/http/src/kdf_pbkdf2.h                              | 1 +
 router/src/metadata_cache/src/group_replication_metadata.h    | 1 +
 router/src/mock_server/src/authentication.h                   | 1 +
 sql/dd/impl/sdi.h                                             | 1 +
 storage/ndb/include/portlib/NdbSleep.h                        | 4 ++++
 storage/ndb/plugin/ndb_sync_excluded_objects_table.cc         | 1 +
 storage/ndb/plugin/ndb_sync_pending_objects_table.cc          | 1 +
 storage/ndb/src/common/util/ndb_zlib.cpp                      | 1 +
 storage/ndb/src/kernel/CMakeLists.txt                         | 1 +
 storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp                 | 2 ++
 18 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/libbinlogevents/include/gtids/global.h b/libbinlogevents/include/gtids/global.h
index 7d388f58e2c..ba75da5e88e 100644
--- a/libbinlogevents/include/gtids/global.h
+++ b/libbinlogevents/include/gtids/global.h
@@ -23,6 +23,7 @@
 #ifndef CS_GTIDS_GLOBALS_INCLUDED
 #define CS_GTIDS_GLOBALS_INCLUDED
 
+#include <cstdint>
 #include <set>
 #include <sstream>
 #include "libbinlogevents/include/uuid.h"
@@ -34,4 +35,4 @@ typedef binary_log::Uuid Uuid;
 
 }  // namespace binary_log::gtids
 
-#endif
\ No newline at end of file
+#endif
diff --git a/libbinlogevents/include/gtids/gtidset.h b/libbinlogevents/include/gtids/gtidset.h
index d6ca13b031b..ef66c72a857 100644
--- a/libbinlogevents/include/gtids/gtidset.h
+++ b/libbinlogevents/include/gtids/gtidset.h
@@ -23,6 +23,7 @@
 #ifndef BINARY_LOG_GTIDS_GTID_SET_INCLUDED
 #define BINARY_LOG_GTIDS_GTID_SET_INCLUDED
 
+#include <cstddef>
 #include <map>
 #include <set>
 #include <sstream>
diff --git a/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_group_management_interface.h b/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_group_management_interface.h
index 34b6a1cde3e..83551aafc26 100644
--- a/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_group_management_interface.h
+++ b/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_group_management_interface.h
@@ -26,6 +26,8 @@
 #include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_member_identifier.h"
 #include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_types.h"
 
+#include <cstdint>
+
 class Gcs_group_management_interface {
  public:
   /**
diff --git a/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_logging.h b/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_logging.h
index fd5f8514cf6..22a1446e787 100644
--- a/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_logging.h
+++ b/plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_logging.h
@@ -24,6 +24,7 @@
 #define GCS_LOGGING_INCLUDED
 
 #include <atomic>
+#include <cstdint>
 #include <string>
 
 #include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_types.h"
diff --git a/plugin/x/src/interface/document_id_generator.h b/plugin/x/src/interface/document_id_generator.h
index 15ba85bf0da..c6e39abbe3e 100644
--- a/plugin/x/src/interface/document_id_generator.h
+++ b/plugin/x/src/interface/document_id_generator.h
@@ -25,6 +25,7 @@
 #ifndef PLUGIN_X_SRC_INTERFACE_DOCUMENT_ID_GENERATOR_H_
 #define PLUGIN_X_SRC_INTERFACE_DOCUMENT_ID_GENERATOR_H_
 
+#include <cstdint>
 #include <cstdio>
 #include <string>
 
diff --git a/router/src/harness/include/mysql/harness/tty.h b/router/src/harness/include/mysql/harness/tty.h
index be666f6388b..a528d6306f5 100644
--- a/router/src/harness/include/mysql/harness/tty.h
+++ b/router/src/harness/include/mysql/harness/tty.h
@@ -27,6 +27,7 @@
 
 #include "harness_export.h"
 
+#include <cstdint>
 #include <ostream>
 
 #ifdef _WIN32
diff --git a/router/src/harness/include/mysql/harness/vt100.h b/router/src/harness/include/mysql/harness/vt100.h
index cd916b33691..3bcc2fb7082 100644
--- a/router/src/harness/include/mysql/harness/vt100.h
+++ b/router/src/harness/include/mysql/harness/vt100.h
@@ -28,6 +28,7 @@
 #include "harness_export.h"
 
 #include <array>
+#include <cstdint>
 #include <string>
 #include <tuple>
 
diff --git a/router/src/http/src/base64.h b/router/src/http/src/base64.h
index df99924f8fc..65cbf2334db 100644
--- a/router/src/http/src/base64.h
+++ b/router/src/http/src/base64.h
@@ -29,6 +29,7 @@
 
 #include <algorithm>  // min
 #include <array>
+#include <cstdint>
 #include <stdexcept>
 #include <string>
 #include <utility>  // index_sequence
diff --git a/router/src/http/src/kdf_pbkdf2.h b/router/src/http/src/kdf_pbkdf2.h
index c5baf786e7e..373ca6aeb13 100644
--- a/router/src/http/src/kdf_pbkdf2.h
+++ b/router/src/http/src/kdf_pbkdf2.h
@@ -24,6 +24,7 @@
 #ifndef MYSQLROUTER_KDF_PBKDF2_INCLUDED
 #define MYSQLROUTER_KDF_PBKDF2_INCLUDED
 
+#include <cstdint>
 #include <stdexcept>
 #include <string>
 #include <vector>
diff --git a/router/src/metadata_cache/src/group_replication_metadata.h b/router/src/metadata_cache/src/group_replication_metadata.h
index cf07d39f93a..417eb7ebc1f 100644
--- a/router/src/metadata_cache/src/group_replication_metadata.h
+++ b/router/src/metadata_cache/src/group_replication_metadata.h
@@ -25,6 +25,7 @@
 #ifndef GROUP_REPLICATION_METADATA_INCLUDED
 #define GROUP_REPLICATION_METADATA_INCLUDED
 
+#include <cstdint>
 #include <map>
 #include <string>
 #include <vector>
diff --git a/router/src/mock_server/src/authentication.h b/router/src/mock_server/src/authentication.h
index dc6cd96033e..b1d0921a41a 100644
--- a/router/src/mock_server/src/authentication.h
+++ b/router/src/mock_server/src/authentication.h
@@ -25,6 +25,7 @@
 #ifndef MYSQL_PROTOCOL_AUTHENTICATION_INCLUDED
 #define MYSQL_PROTOCOL_AUTHENTICATION_INCLUDED
 
+#include <cstdint>
 #include <optional>
 #include <string_view>
 #include <vector>
diff --git a/sql/dd/impl/sdi.h b/sql/dd/impl/sdi.h
index 66514452fa4..ab06fbe438a 100644
--- a/sql/dd/impl/sdi.h
+++ b/sql/dd/impl/sdi.h
@@ -23,6 +23,7 @@
 #ifndef DD__SDI_INCLUDED
 #define DD__SDI_INCLUDED
 
+#include <cstdint>
 #include <functional>
 #include "my_compiler.h"
 #include "sql/dd/sdi_fwd.h"      // RJ_Document
diff --git a/storage/ndb/include/portlib/NdbSleep.h b/storage/ndb/include/portlib/NdbSleep.h
index 22fc401107b..b849b6d12ab 100644
--- a/storage/ndb/include/portlib/NdbSleep.h
+++ b/storage/ndb/include/portlib/NdbSleep.h
@@ -31,6 +31,10 @@
 #include <sys/select.h>
 #endif
 
+#if defined(HAVE_NANOSLEEP)
+#include <time.h>
+#endif
+
 static inline void NdbSleep_MilliSleep(int milliseconds);
 
 static inline
diff --git a/storage/ndb/plugin/ndb_sync_excluded_objects_table.cc b/storage/ndb/plugin/ndb_sync_excluded_objects_table.cc
index d3304558173..ec96aeb3672 100644
--- a/storage/ndb/plugin/ndb_sync_excluded_objects_table.cc
+++ b/storage/ndb/plugin/ndb_sync_excluded_objects_table.cc
@@ -24,6 +24,7 @@
 #include "storage/ndb/plugin/ndb_sync_excluded_objects_table.h"
 
 #include <assert.h>
+#include <cstdint>
 #include <cstring>  // std::strlen
 
 // assert
diff --git a/storage/ndb/plugin/ndb_sync_pending_objects_table.cc b/storage/ndb/plugin/ndb_sync_pending_objects_table.cc
index 02650fbc5d6..926b8c3178f 100644
--- a/storage/ndb/plugin/ndb_sync_pending_objects_table.cc
+++ b/storage/ndb/plugin/ndb_sync_pending_objects_table.cc
@@ -24,6 +24,7 @@
 #include "storage/ndb/plugin/ndb_sync_pending_objects_table.h"
 
 #include <assert.h>
+#include <cstdint>
 #include <cstring>  // std::strlen
 
 // assert
diff --git a/storage/ndb/src/common/util/ndb_zlib.cpp b/storage/ndb/src/common/util/ndb_zlib.cpp
index 461f61c269c..777d845fc96 100644
--- a/storage/ndb/src/common/util/ndb_zlib.cpp
+++ b/storage/ndb/src/common/util/ndb_zlib.cpp
@@ -24,6 +24,7 @@
 #include "util/ndb_zlib.h"
 
 #include <assert.h> // assert()
+#include <cstdint>
 #include <stdlib.h> // abort()
 
 #include "zlib.h"
diff --git a/storage/ndb/src/kernel/CMakeLists.txt b/storage/ndb/src/kernel/CMakeLists.txt
index e443cbb445e..35d2629ea86 100644
--- a/storage/ndb/src/kernel/CMakeLists.txt
+++ b/storage/ndb/src/kernel/CMakeLists.txt
@@ -37,6 +37,7 @@ FOREACH(warning
     "class-memaccess"
     "format-overflow"
     "maybe-uninitialized"
+    "uninitialized"      # RedoPageCache CTOR: m_hash(m_pool) with gcc 13
     "stringop-overflow"
     "unused-but-set-variable"
     "unused-parameter"
diff --git a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index 93d60f9aa13..c2e02b19efc 100644
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -2021,6 +2021,8 @@ void Ndbfs::callFSWRITEREQ(BlockReference ref, FsReadWriteReq* req) const
   Uint32 block = refToMain(ref);
   Uint32 instance = refToInstance(ref);
 
+  ndbrequire(block <= MAX_BLOCK_NO);
+
   SimulatedBlock* main_block = globalData.getBlock(block);
   ndbrequire(main_block != nullptr);
   ndbrequire(instance < NDBMT_MAX_BLOCK_INSTANCES);
From a283899399647ba1855c84327fd6b2cfaa1381e4 Mon Sep 17 00:00:00 2001
From: Tor Didriksen <tor.didriksen@oracle.com>
Date: Tue, 17 Jan 2023 12:25:10 +0100
Subject: [PATCH 2/2] Bug#34278103 Compile MySQL with GCC 13 [noclose]
The newest gcc is stricter about allocator rebind types
we got a static_assert:
allocator_traits<A>::rebind_alloc<A::value_type> must be A
Fixed by having a static MEM_ROOT for allocator unit tests,
and adding rebind::other for allocator wrapper classes.
Change-Id: Ia3b9c29ab2dd371ba97807565dc5c3c174bb4520
(cherry picked from commit 516905d02e829d88ae068d4245c98ed5a8f8e28e)
(cherry picked from commit c249973a46ab97b693ef95ad208bc686e001e0df)
---
 unittest/gunit/stl_alloc-t.cc | 43 +++++++++++++++++++++++++++--------
 1 file changed, 33 insertions(+), 10 deletions(-)
diff --git a/unittest/gunit/stl_alloc-t.cc b/unittest/gunit/stl_alloc-t.cc
index 08316235409..c5e54d4c0cd 100644
--- a/unittest/gunit/stl_alloc-t.cc
+++ b/unittest/gunit/stl_alloc-t.cc
@@ -53,20 +53,43 @@ namespace stlalloc_unittest {
   These wrappers need to inherit so that they are allocators themselves.
   Otherwise TypeParam in the tests below will be wrong.
 */
-template <typename T>
-class Malloc_allocator_wrapper : public Malloc_allocator<T> {
+template <typename T, class A = Malloc_allocator<T>>
+class Malloc_allocator_wrapper : public A {
+  using a_t = std::allocator_traits<A>;
+
  public:
+  template <class U>
+  struct rebind {
+    using other =
+        Malloc_allocator_wrapper<U, typename a_t::template rebind_alloc<U>>;
+  };
+
+  // Inherit CTORs from base class.
+  using A::A;
+
   Malloc_allocator_wrapper() : Malloc_allocator<T>(PSI_NOT_INSTRUMENTED) {}
 };
 
-template <typename T>
-class Mem_root_allocator_wrapper : public Mem_root_allocator<T> {
-  MEM_ROOT m_mem_root{PSI_NOT_INSTRUMENTED, 1024};
+// Use a static mem-root for everything, so that list::splice will work.
+static MEM_ROOT static_mem_root{PSI_NOT_INSTRUMENTED, 1024};
+
+template <typename T, class A = Mem_root_allocator<T>>
+class Mem_root_allocator_wrapper : public A {
+  using a_t = std::allocator_traits<A>;
 
  public:
-  Mem_root_allocator_wrapper() : Mem_root_allocator<T>(&m_mem_root) {
+  template <class U>
+  struct rebind {
+    using other =
+        Mem_root_allocator_wrapper<U, typename a_t::template rebind_alloc<U>>;
+  };
+
+  // Inherit CTORs from base class.
+  using A::A;
+
+  Mem_root_allocator_wrapper() : Mem_root_allocator<T>(&static_mem_root) {
     // memory allocation error is expected, don't abort unit test.
-    m_mem_root.set_error_handler(nullptr);
+    static_mem_root.set_error_handler(nullptr);
   }
 
   /*
@@ -79,9 +102,9 @@ class Mem_root_allocator_wrapper : public Mem_root_allocator<T> {
     even with -std=c++17
   */
   Mem_root_allocator_wrapper(const Mem_root_allocator_wrapper &other)
-      : Mem_root_allocator<T>(&m_mem_root) {
-    memcpy(&m_mem_root, &other.m_mem_root, sizeof(m_mem_root));
-  }
+      : Mem_root_allocator<T>(other.m_mem_root_ptr) {}
+
+  MEM_ROOT *m_mem_root_ptr = &static_mem_root;
 };
 
 /*
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin