1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Commit Graph

2260 Commits

Author SHA1 Message Date
Oleksandr Byelkin
019030adc9 Merge branch '10.11' into 11.4 2026-10-21 09:30:28 +02:00
Oleksandr Byelkin
72a7635ba6 new PCRE2 10.49 2026-10-20 18:58:35 +02:00
Marko Mäkelä
7ee06258b5 Merge 10.11 into 11.4 2026-10-13 07:04:14 +03:00
Sergei Golubchik
322658cd44 fix building of external plugins
ARG_DEPENDS might be empty.

tests should be under <pluginname>/ not under whatever build dir happened
to be named.
2026-09-27 13:55:16 +02:00
Sergei Golubchik
3977a282b7 MDEV-40608 MariaDB-devel is incomplete for plugins
This works on Linux and on Windows, with rpm/deb/tar.gz/zip
installations.

For rpm/deb it just works, for tar.gz/zip there is no
standard location, so one needs to configure plugin with

  -DCMAKE_PREFIX_PATH=/pah/to/mariadb/basedir

after that, `cmake --install .` works too, installing in the same
basedir.

`cmake --build . --target package` works, creating rpm/deb/targz/zip
depending on whether it's Linux or Windows and whether -DRPM or -DDEB
was specified.

* create and install mariadb-plugin-config.cmake
* for now it only supports one plugin per project, error out
  if there are many
* deb: move all headers that plugins need to libmariadb-dev,
  together with libmysqlservices.a. At least until we'll
  create mariadb-plugin-dev. Nobody should need huge
  libmariadbd-dev to develop a plugin
* rpm: all in MariaDB-devel already, no changes here
* install wsrep headers too, THD layout depends on WITH_WSREP
* show DBUG_OFF, ENABLED_DEBUG_SYNC, and SAFE_MUTEX to plugins, same
  reason (it doesn't happen automatically as they're not in my_config.h)
* but don't install config.h - high chance of name conflict with other
  projects and it's an exact copy of my_config.h anyway.
* adjust plugin.cmake to work for external plugins
* move server-internal part of it to top-level CMakeLists.txt
* remove double-defined macros from unireg.h (the guard doesn't help
  if unireg.h is included first)
* package plugin metadata as yaml in .tar.gz/.zip

ColumnStore, until fixed, needs a backward-compatibility workaround
2026-09-25 11:28:53 +02:00
Sergei Golubchik
56becfbe19 fix the build for -G "Ninja Multi-Config" 2026-09-25 11:28:53 +02:00
drrtuy
5fde7c6c7b MDEV-41001: cpack now skips data path that brings symbolic links to fix Windows build. 2026-09-15 14:27:56 +01:00
Daniel Black
218ead5054 MDEV-39285: dtrace to check for sys/sdt.h on Linux
Buildbot SRPM builders show it is possible to have dtrace
(the program) installed without the sys/sdt.h.

The dtrace program using -h generated source code that
includes the sys/sdt.h header so lets make sure it exists.

To make sure that SRPM picks up all include headers,
we check that in cmake/build_depends.cmake and let
the discovery of all the include headers contribute
to the build dependencies. Where there is multiple assume
that all header files original from the same package
and search for the last one.
2026-09-04 09:20:11 +10:00
Oleksandr Byelkin
170b1d7073 Merge branch '10.11' into 11.4 2026-08-19 08:40:05 +02:00
Oleksandr Byelkin
e2b15641ec Merge branch '10.6' into 10.11 2026-08-19 08:13:54 +02:00
Daniel Black
3064caf84c MDEV-40630: stunnel as Deb/RPM recommends for rsync sst
stunnel has been a component used by the rsync SST mechanism of galera
but has never been listed as a package dependency.

Since MDEV-28233 corrected a unencrypted fallback in the the case of
stunnel being absent, we add stunnel as a recommendation for Debian and
RPM packages.
2026-08-10 18:03:50 +02:00
Sergei Golubchik
e3d62d4e78 MDEV-40629 environment injection via wsrep bootstrap in the service file
* don't create mariadb-wsrep-new-cluster in the mariadbd-writable path,
  the server should not be able to poison the environment with OUTFILE.
  Create it in /run
* As in /run it must be deleted by root, let galera_new_cluster delete
  it, not the service
* wsrep-start-position cannot be created by root, so avoid a file
  for it at all

Assisted-By: Claude:claude-5-opus
2026-08-06 16:29:00 +02:00
forkfun
08eeb6a417 Merge branch '10.11' into '11.4' 2026-07-28 13:14:38 +02:00
Sergei Golubchik
afbab154f1 post-merge fixes
* restore result=NULL after free in mysqlshow.c (to prevent double-free)
* remove DBUG_EVALUATE_IF again
* remove useless 'stop slave' from a test
* restore charset encoding in mysqltest.{test,result}
* correct error for unparseable BINLOG data is ER_SYNTAX_ERROR now
* restore old libfmt on rhel-7, gcc 4.8.5 cannot compile anything newer
2026-07-24 17:06:39 +02:00
forkfun
b116640546 Update HeidiSQL to 12.20, update libfmt to 12.2.0, fix galera_sst_mariabackup_lost_found.test (forgotten semicolon) 2026-07-23 15:49:08 +02:00
Georgi (Joro) Kodinov
b600bf4b90 MDEV-40391: a CMP0218 warning with cmake 4.4
IF() still evaluates the RHS of an AND condition and this causes
the warning here to be thrown for accsseing deprecated variables,
CMAKE_WARN_DEPRECATED in this case.

Fixed by splitting the IF() into two nested IF()s.
2026-07-15 13:30:03 +03:00
Marko Mäkelä
3ce999df6b Merge 10.11 into 11.4 2026-06-26 13:45:38 +03:00
Vladislav Vaintroub
84a859a636 MDEV-38369 improve heap allocation performance on Windows with segmentHeap
Use modern segmentHeap heap manager on Windows.

The problem it is solving is severily reduced scalability on concurrent
OLTP benchmarks, due to inherent scalability problems in default NT Heap
implementation.

The benchmarks (see the corresponding ticket) show improvements across
the board, with about 5-10% on low concurrency up to several orders of
magnitude on high concurrency.

Also addressed Gemini and Copilot concerns about correct namespace in
the app manifest XML file - make it the same as in Microsoft examples.
2026-06-22 23:18:36 +03:00
Sergei Golubchik
1fb075512a refactor submodule.cmake to fetch less
don't update all submodules automatically,
only update those that are actually used by the build
2026-06-19 13:59:59 +02:00
Kristian Nielsen
85ec122c15 Merge 10.11 to 11.4
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-06-15 12:50:45 +02:00
Sergei Golubchik
71cafa8114 duckdb-engine rpm/deb fixes
no additional depencenies = server component
2026-06-08 11:50:56 +02:00
Daniel Black
8923afa5c2 MDEV-39584: update help sql tables and replace KB links
scripts/fill_help_tables.sql from
https://github.com/mariadb-corporation/mariadb-docs/ as of
3fb208fcdfed06beb52ef9e305017de2387ff012

Other URL changes are taken from the HTTP redirection URL
from the old KB.

Some test cases where impacted:
* ps_missed_cmds{,_bin_prot} - used a topic_id of 0 that is
 now used, used MAX_INT instead.

* range_notembedded used the help data as a test case. As its not
  a stable table data, replaces with static data. Test case valid
  by ensuring the ANALYZE EXPLAIN and optimizer trace had the same
  structure. Also valided the MDEV-24739/MDEV-25069 bug fixes from
  where the test case originaled, when reverted, exhibited the
  previous behavour before the bug fixes.
2026-05-15 13:30:21 +10:00
Oleksandr Byelkin
7598e4e95d Merge branch '10.11' into 11.4 2026-05-08 08:00:01 +02:00
Marko Mäkelä
58f507206f Merge 10.6 into 10.11 2026-04-20 11:07:30 +03:00
Sergei Golubchik
04ad6c7070 cleanup: make_dist.cmake.in
remove broken code duplication that
* explicitly listed every submodule that had its own submodules
* blindly executed `${GIT_EXECUTABLE}` after every `(SET GIT_EXECUTABLE)`
2026-04-19 11:36:16 +02:00
Daniel Black
e2f91f4289 MDEV-38771 RPM conflicts between MariaDB-common and mysql-common
mysql-common and MariaDB-common don't install the same files.
mysql-common (in MySQL 8.0) installs character set files
(/usr/share/mysql/charsets/*) and /usr/lib64/mysql (directory only).

MariaDB common installs character set files in /usr/share/mariadb
and the same /usr/lib64/mysql directory along with client plugins
in /usr/lib64/mysql/plugin. The RPM rules of conflict
only will cause troubles on directories if they are installed with
different metatadata (selinux, ownership, permissions) which isn't
the case.

As the character sets are at a different location MariaDB-common
isn't obsoleting mysql-common in a way that provides compatibilty
with mysql-common, for mysql-libs or otherwise, so its just creating
an install conflict.

Users installing perl-DBD-MySQL notice this because its mysql-libs
dependency pulls mysql-common, which conflicts with MariaDB-common.

We correct by removing the conflict and the provides of MariaDB-common
with resepect to mysql-common.
2026-04-18 08:16:18 +10:00
Yuchen Pei
c6fadc6e33 Merge branch '10.11' into 11.4 2026-04-16 11:28:26 +10:00
Sergei Golubchik
8229217206 don't create build files like mysqlserver-$<CONFIG>.mri.tpl
cmake generator expressions are expanded *during the build step*.
If the file is created *during the configuration step* its name
cannot use generator expressions.
2026-04-13 10:50:37 +02:00
Daniel Black
1cedade691 MDEV-39157 BUILD_TYPE=mysql_release to remove compile flags
BUILD_TYPE=mysql_release changes a bunch of build flags on Linux/UNIX
systems and our CI processes insufficiently test the impacts of these.

This effectively drops the gcc/clang optimization from O3 of a
release down to O2. The performance gains of O3 vs O2 are currently
insufficiently tested (MDEV-19734 is outstanding).

What is clear is amd64v3 is providing the ability of enhanced MMX
instructions which causes segfaults on unaligned addresses
(MDEV-38989 and others). As compilers get smarter and O3 provides
more transforms is safer if the CMAKE_BUILD_TYPE=RelWithDebInfo
experiences of CI have identical compile flags, with BUILD_TYPE=mysql_release
changing to present required features only.

This resolves MDEV-35809 by removing the specialized optimization
for platforms that are unsupported or unmaintained per PR #3744
comments.
2026-04-10 17:55:40 +10:00
Michal Schorm
7adb15a0b8 MDEV-14373: Reject incompatible PLUGIN_xxx build mode at configure time
When a user sets -DPLUGIN_PARTITION=DYNAMIC or
-DPLUGIN_PERFSCHEMA=DYNAMIC, these plugins are declared
STATIC_ONLY in their CMakeLists.txt. Previously, the
MYSQL_ADD_PLUGIN macro would silently skip building such
plugins: the STATIC branch wouldn't match (because the user
requested DYNAMIC), and the DYNAMIC branch would be blocked
by ARG_STATIC_ONLY. The plugin was simply not built.

This caused confusing downstream compile errors in other
plugins that depended on the missing one:

  - PLUGIN_PARTITION=DYNAMIC -> CONNECT fails:
    'struct TABLE_SHARE' has no member named
    'partition_info_str_len'
    'struct TABLE' has no member named 'part_info'

  - PLUGIN_PERFSCHEMA=DYNAMIC -> MariaBackup fails:
    'MY_WME' was not declared in this scope
    'my_read' was not declared in this scope
    'MY_FILE_ERROR' was not declared in this scope

  - PLUGIN_ARIA=DYNAMIC -> Spider fails:
    'MARIA_COLUMNDEF' has not been declared
    (Note: Aria is now MANDATORY and already overrides
    user input; this was likely reproducible in older
    versions where Aria was DEFAULT)

Root cause: The MYSQL_ADD_PLUGIN macro in
cmake/plugin.cmake did not validate that the
user-requested build mode (STATIC or DYNAMIC) was
compatible with the plugin's declared capabilities
(STATIC_ONLY or MODULE_ONLY).

Fix: Add validation immediately after the existing
PLUGIN_xxx value check. If DYNAMIC is requested for a
STATIC_ONLY plugin, or STATIC is requested for a
MODULE_ONLY plugin, emit a FATAL_ERROR with a clear
message telling the user which option to use instead.

Non-MANDATORY plugins with STATIC_ONLY (the new check
catches -DPLUGIN_xxx=DYNAMIC for these):
  - partition (sql/CMakeLists.txt)
  - perfschema (storage/perfschema/CMakeLists.txt)
  - thread_pool_info (sql/CMakeLists.txt)

Conditionally STATIC_ONLY (platform/config-dependent):
  - feedback (only on Windows)

The MANDATORY + STATIC_ONLY plugin sql_sequence is
unaffected: the MANDATORY flag overrides user input to
YES before the new check runs.

MODULE_ONLY plugins (the new check catches
-DPLUGIN_xxx=STATIC for these) include all dynamically-
loaded plugins: federated, spider, rocksdb, mroonga,
oqgraph, example, and ~25 others under plugin/ and
storage/.

The YES and AUTO modes are unaffected since they already
gracefully fall through to whichever mode the plugin
supports.

Co-Authored-By: Claude AI <noreply@anthropic.com>
2026-04-07 15:31:21 +03:00
Marko Mäkelä
a6c9013965 Merge 10.11 into 11.4 2026-03-11 14:18:49 +02:00
Marko Mäkelä
072c7dc774 MDEV-38671: Default to large innodb_buffer_pool_size_max (except on AIX)
my_large_virtual_alloc(): If large page allocation fails, clear
my_use_large_pages. Outside large page allocation (and IBM AIX),
invoke mmap(2) with PROT_NONE so that no page table entries will
have to be allocated. Also, fix the error reporting.

my_virtual_mem_commit(): Do not set the Linux specific flag MAP_POPULATE
because it would introduce a performance regression on startup.
There is a better, system-wide way to disable the overcommit:

	sudo sysctl vm.overcommit_memory=2

HAVE_UNACCESSIBLE_AFTER_MEM_DECOMMIT: Remove. We will always make
the virtual memory unaccessible, so that the operating system
can deallocate the page table entries.

buf_pool_t::create(): Skip the my_virtual_mem_commit() on AIX only.

buf_pool_t::page_guess(): Unconditionally check if the pointer is
within the currently allocated buffer pool.

innodb_buffer_pool_size_max: On 64-bit systems other than IBM AIX,
we will default to 8 TiB.

On 32-bit systems, we retain the default innodb_buffer_pool_size_max=0,
that is, by default, SET GLOBAL innodb_buffer_pool_size=... will be
unable to increase from the initial value.

There is no functional change to the startup logic that adjusts
innodb_buffer_pool_size_max to be at least innodb_buffer_pool_size
rounded up to the extent size (2 MiB on 32-bit, 8 MiB on 64-bit).
2026-03-02 11:30:56 +02:00
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