Commit graph

2,228 commits

Author SHA1 Message Date
Sergei Golubchik
40f7084661 Merge branch '10.11' into 11.4 2026-01-28 21:52:18 +01:00
Sergei Golubchik
b29d3779e4 Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
Vladislav Vaintroub
52b1d7eb7f libfmt 12.1 - Suppress warning, MSVC-specific
discarding return value of function with [[nodiscard]] attribute
for std::isalpha

This comes from libfmt templated code
2026-01-20 15:41:19 +01:00
Vladislav Vaintroub
496767b310 pcre2 10.47 2026-01-20 11:07:04 +01:00
Vladislav Vaintroub
42c260bc0f MDEV-37997 vcpkg's FIND_PACKAGE throws error for zlib dependent packages
Build with vcpkg and WITH_ZLIB=bundled throws error
"Broken installation of vcpkg port zlib" in FIND_PACKAGE(CURL)

Set CMAKE_DISABLE_FIND_PACKAGE_ZLIB to workaround.

Previously, this workaround was hashicorp specific, now we need this also
for videx. Thus setting CMAKE_DISABLE_FIND_PACKAGE_ZLIB was moved to
correct place,  inside MYSQL_USE_BUNDLED_ZLIB macro.
2026-01-19 16:36:55 +01:00
Sergei Golubchik
32c846e9fc MDEV-38237 Incorrect BuildRequires entry in RHEL10 srpm
apparently a file can be present in *more than one* rpm,
e.g. /usr/bin/dtrace on rhel10 is present *both* in
systemtap-sdt-dtrace and in systemtap-sdt-devel.

Make sure there's a separator between entries.
2026-01-14 19:44:30 +01:00
Sergei Golubchik
edda8d54c1 MDEV-38133 Package mariadb-common conflicts with mysql-common 2026-01-14 19:44:30 +01:00
Daniel Black
2bccd1d506 MDEV-15502 debian: systemd, with tmpfiles install not required
With PermissionsStartOnly deprecated, remove this from the
systemd service file.

Replace Debian's ExecStartPre "install -d" with a tmpfile
configuration directive creating the directory with this.

Debian's ExecStartPost of the mariadb upgrade uses the !
special executable prefix added in systemd v231 to use
root privs.
2026-01-14 09:58:43 +01:00
Daniel Black
4b5e684606 MDEV-37726 wsrep-new-cluster and wsrep-start-position in wrong directory with wrong selinux permissions
After moving the systemd service to using environment files
instead of `systemctl set-environment` in 11.6 (MDEV-19210),
they (wsrep-new-cluster and wsrep-start-position) are located
in /var/lib/mysql along with the socket file in
Fedora/RHEL-based distros. This causes them to have incorrect
selinux permissions and therefore be not readable by systemd.

A solution is to generate these files in the run directory,
instead, which already has correct selinux label mysqld_var_run_t
mysql-selinux-1.0.12. Dissociating these files and the socket
in CMake configs can also prove useful for other things.

This also corrects some of the duplicate code in the build
scripts and made INSTALL_RUNDATADIR into a proper location
and used this for the tmpfiles where the temporary files
are created.

Debian's location is /run/mysqld/ matching its INSTALL_UNIX_ADDRDIR,
which is now a temporary location controlled by tmpfiles.
2026-01-14 09:58:43 +01:00
Marko Mäkelä
678ff03ee7 Merge 10.11 into 11.4 2026-01-02 11:53:09 +02:00
Otto Kekäläinen
5cbe01730d MDEV-38332 Detect Hurd based on CMAKE_SYSTEM_NAME being "GNU"
In 22afd13 Hurd detection was introduced using the processor type,
as incidentally only the hurd-i386 build on Debian was using i686.
This method however does not detect a hurd-amd64 system. Fix this
by using the actual system name following CMake conventions.

Hurd is a kernel project by the GNU project, thus system is called
"GNU".
2025-12-18 12:58:36 +11:00
Sergei Golubchik
f230c0ff6e Merge branch '10.11' into 11.4 2025-11-04 13:44:16 +01:00
Daniel Black
f1aaa75184 MDEV-15502 debian: systemd, with tmpfiles install not required
With PermissionsStartOnly deprecated, remove this from the
systemd service file.

Replace Debian's ExecStartPre "install -d" with a tmpfile
configuration directive creating the directory with this.

Debian's ExecStartPost of the mariadb upgrade uses the !
special executable prefix added in systemd v231 to use
root privs.
2025-10-25 10:23:26 +11:00
Daniel Black
649216e70d MDEV-37726 wsrep-new-cluster and wsrep-start-position in wrong directory with wrong selinux permissions
After moving the systemd service to using environment files
instead of `systemctl set-environment` in 11.6 (MDEV-19210),
they (wsrep-new-cluster and wsrep-start-position) are located
in /var/lib/mysql along with the socket file in
Fedora/RHEL-based distros. This causes them to have incorrect
selinux permissions and therefore be not readable by systemd.

A solution is to generate these files in the run directory,
instead, which already has correct selinux label mysqld_var_run_t
mysql-selinux-1.0.12. Dissociating these files and the socket
in CMake configs can also prove useful for other things.

This also corrects some of the duplicate code in the build
scripts and made INSTALL_RUNDATADIR into a proper location
and used this for the tmpfiles where the temporary files
are created.

Debian's location is /run/mysqld/ matching its INSTALL_UNIX_ADDRDIR,
which is now a temporary location controlled by tmpfiles.
2025-10-25 10:23:26 +11:00
Oleksandr Byelkin
3c3f06cc2a libfmt 12.0 2025-10-20 20:09:56 +02:00
Vladislav Vaintroub
cabb77c9a1 MDEV-33474 postfix - refine include/exclude rules for runtime dependencies
Don't exclude OpenSSL runtime dependencies, even if they are in
Windows system directory. chocolatey package manager, and underlying
ShiningLight installer and manager puts them there.

Previously, the assumption was that system32 only contains OS libraries.
That is normally also the case, except this specific case.
2025-10-10 18:27:37 +02:00
Marko Mäkelä
5cf9d846ea Merge 10.11 into 11.4 2025-10-01 07:24:54 +03:00
Daniel Black
db135822f6 MDEV-37680/MDEV-24941: RHEL9+,Centos-stream and Fedora to pull mysql-selinux-1.0.14+ dependency
mysql-selinux-1.0.14 provides the necessary labels for
MariaDB to function correctly.

Thanks Pavol Sloboda for the bug forwarding and a ready to
package solution.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2395701
2025-10-01 08:51:04 +10:00
Nikita Malyavin
0108664a8a Merge branch 10.11 into 11.4
# Conflicts:
#	sql/handler.h
#	sql/log_event.h
#	sql/log_event_server.cc
2025-09-02 15:58:39 +02:00
Daniel Black
0c80ddb519 MDEV-36542: apply clang -Werror=uninitialized to catch dubious initializations
clang has rather correct error detection in its
implementation of the -Werror=uninitialized* set of C/CXX flags.

Use them by default.
2025-07-29 13:15:02 +10:00
Sergei Golubchik
c4ed889b74 Merge branch '10.11' into 11.4 2025-07-28 19:40:10 +02:00
ParadoxV5
33e845595d MDEV-36839: Revert MDEV-7409
MDEV-6247 added PROCESSLIST states for when a Replication
SQL thread processes Row events, including a WSRep variant
that dynamically includes the Galera Sequence Number.
MDEV-7409 further expanded on it by adding the table name to the states.

However, PROCESSLIST __cannot__ support generated states.
Because it loads the state texts asynchronously,
only permanently static strings are safe.
Even thread-local memory can become invalid when the thread terminates,
which can happen in the middle of generating a PROCESSLIST.

To prioritize memory safety, this commit reverts both variants to
static strings as the non-WSRep variant was before MDEV-7409.
* __Fully__ revert MDEV-7409 (d9898c9a71)
* Remove the WSRep override from MDEV-6247
  * Remove `THD::wsrep_info` and its compiler
    flag `WSREP_PROC_INFO` as they are now unused

This commit also includes small optimizations
from MDEV-36839’s previous draft, #4133.

Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
2025-07-22 10:05:24 -06:00
Marko Mäkelä
a87bb96ecb MDEV-36234: Add innodb_linux_aio
This controls which linux implementation to use for
innodb_use_native_aio=ON.

innodb_linux_aio=auto is equivalent to innodb_linux_aio=io_uring when
it is available, and falling back to innodb_linux_aio=aio when not.

Debian packaging is no longer aio exclusive or uring, so
for those older Debian or Ubuntu releases, its a remove_uring directive.
For more recent releases, add mandatory liburing for consistent packaging.

WITH_LIBAIO is now an independent option from WITH_URING.

LINUX_NATIVE_AIO preprocessor constant is renamed to HAVE_LIBAIO,
analogous to existing HAVE_URING.

tpool::is_aio_supported(): A common feature check.

is_linux_native_aio_supported(): Remove. This had originally been added in
mysql/mysql-server@0da310b69d in 2012
to fix an issue where io_submit() on CentOS 5.5 would return EINVAL
for a /tmp/#sql*.ibd file associated with CREATE TEMPORARY TABLE.
But, starting with commit 2e814d4702 InnoDB
temporary tables will be written to innodb_temp_data_file_path.
The 2012 commit said that the error could occur on "old kernels".
Any GNU/Linux distribution that we currently support should be based
on a newer Linux kernel; for example, Red Hat Enterprise Linux 7
was released in 2014.

tpool::create_linux_aio(): Wraps the Linux implementations:
create_libaio() and create_liburing(), each defined in separate
compilation units (aio_linux.cc, aio_libaio.cc, aio_liburing.cc).

The CMake definitions are simplified using target_sources() and
target_compile_definitions(), all available since CMake 2.8.12.
With this change, there is no need to include ${CMAKE_SOURCE_DIR}/tpool
or add TPOOL_DEFINES flags anymore, target_link_libraries(lib tpool)
does all that.

This is joint work with Daniel Black and Vladislav Vaintroub.
2025-06-23 13:51:52 +03:00
Vladislav Vaintroub
e63e0e4c6f MDEV-36904 Improve runtime DLL packaging on Windows
Include PATH in DLL search paths to support broader scenarios.
Enables use of common distros like OpenSSL from Shining Light Productions
(used by Chocolatey, AppVeyor, etc).
Previously, only vcpkg libraries were detected.
2025-06-18 23:42:02 +02:00
Oleksandr Byelkin
89c7e2b9c7 Merge branch '10.11' into 11.4
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
2025-06-17 09:50:22 +02:00
Daniel Black
22afd13e7a Debian/Hurd doesn't support auth_socket
Hurd doesn't have the mechanism to identify the user connecting to
a socket via a system call as MDEV-8535 highlighted. As such it
can't be supported so we disable it in Debian's mysql_release profile.

Hurd string from uname -m, "SYSTEM processor: i686-AT386" in mariadb
output. And wiki reference https://en.wikipedia.org/wiki/Uname

Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006531
2025-06-18 09:11:28 +10:00
Brad Smith
6d684b64d5 Rocksdb: Add missing getauxval() test for Linux 2025-06-13 14:08:22 +10:00
Vladislav Vaintroub
dd2982dc33 MDEV-30831 Cannot compile AWS KMS Plugin
Fix AWS SDK build, it has changed substantionally since the plugin was
introduced. There is now a bunch of intermediate C libraries, aws-cpp-crt
and others, and for static linking, the link dependency must be declared.

Also support AWS C++ SDK in vcpkg package manager.
2025-06-10 15:18:28 +02:00
Vladislav Vaintroub
9bf0492b7d MDEV-36904 Improve runtime dependency packaging on Windows
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
Background:
In MDEV-33474, we introduced runtime dependency packaging primarily to
support libcurl and other potential third-party dependencies from vcpkg.

Problem:
The INSTALL(RUNTIME_DEPENDENCY_SET) command was failing at packaging step
unless shared libraries from the same build were explicitly excluded via
PRE_EXCLUDE_REGEXES. While initially only server.dll was excluded this way,
this turned out insufficient for users compiling their own plugins

Solution:
Exclude all linked shared libraries from the same build via
PRE_EXCLUDE_REGEXES. Move dependency detection and install to the end of
CMake processing, after all add_library/add_executable calls, when all
targets are known.

Also made the INSTALL_RUNTIME_DEPENDENCIES variable independent of vcpkg
detection, for simplicity.
2025-06-10 13:23:54 +02:00
Oleksandr Byelkin
28d6530571 Merge branch '10.6' into 10.11 2025-06-04 14:09:23 +02:00
Brad Smith
6409e43177 Replace deprecated CMAKE_COMPILER_IS_GNU(CC|CXX) with CMAKE_(C|CXX)_COMPILER_ID
As of CMake 3.24 CMAKE_COMPILER_IS_GNU(CC|CXX) are deprecated and should
be replaced with CMAKE_(C|CXX)_COMPILER_ID which were introduced with
CMake 2.6.
2025-06-03 18:16:35 +10:00
Daniel Black
f533333f82 MDEV-34388: Stack overflow on Alpine Linux (postfix) - sanitizers
Remove stack limits for sanitizers. Other tests cover them.
2025-06-02 11:40:39 +02:00
Daniel Black
8490901307 MDEV-34388: Stack overflow on Alpine Linux (postfix - ASAN/MSAN+Debug)
In original fix, commit 82d7419e06,
a 16k stack frame limit was imposed. Under the stack usage is doubled due
to MSAN. Debug builds without optimization can use more as well.

ASAN Debug builds also exceeded the 16k stack frame limit.

To keep some safety limit, a 64k limit is imposed to the compiler
under MSAN or ASAN with CMAKE_BUILD_TYPE=Debug.
2025-05-28 16:29:03 +10:00
Vladislav Vaintroub
d665810cf0 Windows/ARM64 - fix build with clang-cl 2025-05-26 12:40:30 +02:00
Marko Mäkelä
1c7209e828 Merge 10.6 into 10.11 2025-05-21 07:36:35 +03:00
Marko Mäkelä
82d7419e06 MDEV-34388: Stack overflow on Alpine Linux
page_is_corrupted(): Do not allocate the buffers from stack,
but from the heap, in xb_fil_cur_open().

row_quiesce_write_cfg(): Issue one type of message when we
fail to create the .cfg file.

update_statistics_for_table(), read_statistics_for_table(),
delete_statistics_for_table(), rename_table_in_stat_tables():
Use a common stack buffer for Index_stat, Column_stat, Table_stat.

ha_connect::FileExists(): Invoke push_warning_printf() so that
we can avoid allocating a buffer for snprintf().

translog_init_with_table(): Do not duplicate TRANSLOG_PAGE_SIZE_BUFF.

Let us also globally enable the GCC 4.4 and clang 3.0 option
-Wframe-larger-than=16384 to reduce the possibility of introducing
such stack overflow in the future.  For RocksDB and Mroonga we relax
these limits.

Reviewed by: Vladislav Lesin
2025-05-20 17:27:05 +03:00
Oleksandr Byelkin
a8d4642375 Merge branch '10.11' into 11.4 2025-04-26 10:53:02 +02:00
Oleksandr Byelkin
4d41ec081e Merge branch '10.6' into 10.11 2025-04-26 10:47:03 +02:00
Oleksandr Byelkin
19644f6821 Merge branch '10.5' into 10.6 2025-04-26 10:41:52 +02:00
Sergei Golubchik
9579ee4fa2 Revert "MDEV-36591: RHEL8(+compat)/Ubuntu 20.04 cannot start systemd servce (EXIT_CAPABILTIES/218)"
This reverts commit 8925877dc8.
2025-04-25 17:48:13 +02:00
Sergei Golubchik
2fa50befbd rpm: restore MariaDB-test dependency on MariaDB-common
after 41b036bff0
2025-04-23 12:57:14 +02:00
Daniel Black
8925877dc8 MDEV-36591: RHEL8(+compat)/Ubuntu 20.04 cannot start systemd servce (EXIT_CAPABILTIES/218)
Combined AmbientCapabilities and CapabilityBoundingSet configuration
within a service file we have found by testing aren't supported in the
systemd v245 (Ubuntu 20.04) and v239 (RHEL8) for non-root users. This
resulted in a service start error EXIT_CAPABILITIES, a systemd limitation
of the version that we cannot work around consequences.

The systemd version 247 these combined capabilities have been tested to
work on Debian 11. No other supported major distros run systemd
version 246, and if they did, the missing capability of CAP_IPC_LOCK
won't be noticed as it was a convenience for --memlock users.

As such we disable the AmbientCapabilites for CAP_IPC_LOCK rather
that disabling the CapabilityBoundingSet, because doing the later
will disable authentication for MariaDB users that have configured PAM
with MariaDB.

Should a user require CAP_IPC_LOCK they can append in their own
systemd overlay file this configuration in the CapabilityBoundingSet
and configure the capability file attributes on the mariadbd executable
to have the IPC_LOCK capability. This isn't configured by default as the
presence of a capability in the MariaDB Server is detected by
openssl libraries as "insecure" which will then ignore any user configured TLS
configuration file passed though by the OPENSSL_CONF environment variable.
2025-04-23 12:57:14 +02:00
Sergei Golubchik
f5405ef511 RPM fixes for centos
centos can go up to "centosstream10" now
2025-04-23 12:57:14 +02:00
Oleksandr Byelkin
616fb6831d new libfmt 2025-04-20 21:54:17 +02:00
Vladislav Vaintroub
11324875b4 MDEV-33474 Windows packaging - install runtime dependencies
Use CMake 3.21 (semi)automatic dependency resolution to install server
and plugin dependencies (DLLs).

This is especially useful with 3rd party dependencies, such as Curl, zlib
etc
2025-04-16 13:22:28 +02:00
Daniel Black
6cff704e57 MDEV-35512 remove all RPM compat packages
The end of life of SLES 12 combined with the
EOL for Centos/RHEL 7 marks a happy time in
our distribution maintaince where we can drop
all RPM compat packages.

They where only needed for distros that
we released at the time of MariaDB-10.1.

All those have finally gone EOL. Horray!
2025-04-14 09:07:23 +10:00
Vladislav Vaintroub
b005b6097f Cleanup CMake code (Windows-specific)
Prepare for a more modern CMake version than the current minimum.

- Use CMAKE_MSVC_RUNTIME_LIBRARY instead of the custom MSVC_CRT_TYPE.
- Replace CMAKE_{C,CXX}_FLAGS modifications with
  add_compile_definitions/options and add_link_options.
  The older method already broke with new pcre2.
- Fix clang-cl compilation and ASAN build.
- Avoid modifying CMAKE_C_STANDARD_LIBRARIES/CMAKE_CXX_STANDARD_LIBRARIES,
  as this is discouraged by CMake.
- Reduce system checks.
2025-04-04 08:58:40 +02:00
Sergei Golubchik
28425cc276 Merge branch '10.11' into 11.4 2025-03-31 22:28:52 +02:00
Sergei Golubchik
730dcf7e6d Merge branch '10.6' into 10.11 2025-03-31 17:57:43 +02:00
Vladislav Vaintroub
8363d05f4d Fix Windows build to use dynamic DLL runtime (MD) by default
This change partially reverts commit b60aee58c7

Previously, we compiled with the flags:
/MT /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib,
which resulted in a non-standard setup where the Universal C Runtime
(UCRT) was dynamically linked, but the compiler runtime was statically
linked. Goal was to reduce runtime dependency, while still using dynamic
CRT

However, now now causes subtle static initialization issues
(and also some problems with MSVC ASAN)

To fix, we now use standard /MD, so both C runtime and compiler runtime
dynamically linked. MSVC redistributable DLL (vcruntime140.dll) is
required on the system, similar to version 10.4.

Our packaging, both zip and MSI, is already prepared for it.
2025-03-31 15:37:10 +02:00