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

1827 Commits

Author SHA1 Message Date
Sergei Golubchik
50dd408f81 Merge branch '10.11' into 11.4 2026-10-15 20:25:34 +02:00
PranavKTiwari
b9d4b10954 MDEV-39245: Added ASCII validation at two points using my_string_repertoire():
1. Built-in plugins (plugin_init):
   A non-ASCII builtin name is a developer error. Added a check
   using my_string_repertoire() that prints an error via
   print_init_failed_error() and returns 1 to abort server startup.

2. Dynamically loaded plugins (plugin_add):
   Added a pre-validation loop before the registration loop. If any
   plugin name in the .so is non-ASCII, the entire .so is rejected
   before any plugin is registered, preventing partial state where
   valid plugins from the same .so get left INACTIVE in the hash.

Added test plugins and MTR tests to verify both rejection of
non-ASCII named plugins and successful loading of ASCII named plugins.
2026-10-12 12:03:54 +05:30
Aleksey Midenkov
30e7c940ff handlersocket.basic unstable result fix
The test fails on random secret with backslash.

The random handlersocket_plain_secret is generated from the '0'..'z'
range, which includes the backslash. The test masked the secret with
--replace_result $HS_SECRET, and mysqltest parses --replace_result
arguments with backslash escapes, so the search string lost the
backslash and did not match the output. The unmasked secret then
appeared in the result (about 19% of runs).

The fix masks the secret in SQL: IF(variable_name LIKE
'handlersocket_plain_secret%', 'HS_SECRET', variable_value), which does
not depend on the secret value.
2026-10-01 23:05:42 +03: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
Sergei Golubchik
851f52470d MDEV-40678 mysql_json plugin OOB reads 2026-08-09 09:53:09 +02:00
Sergei Golubchik
0931994096 MDEV-40670 qc_info OOB read if query contains \0
qc_info cannot parse query cache key, this cannot be done
without changing query cache key format.

let's limit the (possibly incorrect) db_length to make sure
it does not extend beyond the db name end, this way there will be no
OOB reads and no information leak.
2026-08-07 22:54:50 +02:00
Sergei Golubchik
69ce9cbcc2 MDEV-40658 file_key_management crash on empty FILE: file 2026-08-06 20:49:23 +02:00
Teemu Ollakka
af9e20aac1 wsrep_info MTR: disable SSL by default for SST 2026-08-04 15:09:08 +03:00
Oleksandr Byelkin
c57069561c New CC 3.4 2026-07-31 10:38:14 +02:00
forkfun
08eeb6a417 Merge branch '10.11' into '11.4' 2026-07-28 13:14:38 +02:00
Sergei Golubchik
3f6f51e662 MDEV-40425 handlersocket crashes on read with huge number of fields
* fix handlersocket to unlink it's THD, this apparently was broken
  for years
* add a check for fldnum
* add a first ever handlersocket test
2026-07-24 17:06:40 +02:00
Sergei Golubchik
03a9678f15 MDEV-39841 handlersocket plugin default secret is empty
if handlersocket_plain_secret is not specified, generate a random one.
one can still set an empty secret in my.cnf if needed.
2026-07-24 17:06:40 +02:00
forkfun
ad7f29afb3 Merge branch 10.6 into 10.11 2026-07-23 11:12:27 +02:00
Daniel Black
1e972a8d70 Merge 10.11 into 11.4 2026-07-14 12:49:36 +10:00
Vladislav Vaintroub
1088d51f66 MDEV-34074 server_audit crashes in get_loc_info() with NULL loc_info
THDVAR(thd, loc_info) can return NULL if the plugin was previously
uninstalled. get_loc_info() and its callers dereferenced it.

Guard against a NULL loc_info in get_loc_info(), auditing() and
log_current_query(). Such a session is not audited.
2026-07-06 12:01:04 +03:00
Vladislav Vaintroub
0579ceb68d MDEV-37187 hashicorp plugin: avoid expensive clock() in hot path
The plugin used clock() only to timestamp cache entries and measure
elapsed time against millisecond timeouts. As shown in MDEV-12345,
clock() is prohibitively expensive, and we do not need per-thread or
per-process CPU time here, only time differences.

Replace clock()/clock_t with the monotonic std::chrono::steady_clock.
Timeouts are kept as std::chrono::milliseconds
2026-06-30 12:19:26 +03:00
Sergei Golubchik
0bf0e13a22 MDEV-40058 cached_sha2_password crashes on zero-length password
valid encrypted password cannot have zero length and must end with '\0'
2026-06-17 16:46:39 +02:00
Oleksandr Byelkin
7598e4e95d Merge branch '10.11' into 11.4 2026-05-08 08:00:01 +02:00
Daniel Black
7efbb0d0b2 MDEV-38913: pam_mariadb_mtr.so installation path change
This reverts the effect of MDEV-21654 and includes
pam_mariadb_mtr in the mariadb-test-data Deb package.

This allows our CI systems to run tests on the
pam implementation on Debian systems.

As the pam configuration can include a full path,
we've change the installation of the pam module
pam_mariadb_mtr.so to under the /usr/lib*/plugins/test_pam_modules
directory and configured the pam configuration file,
suite/plugins/pam/mariadb_mtr, to include the
full path to pam_mariadb_mtr.so.
2026-05-03 19:17:17 +10:00
Sergei Golubchik
f34afeaf6b MDEV-39318 MTR: fix test failures when running with --ssl
make sure P_S.{global|session}_status and I_S.feedback plugin table
have a column of the same width as I_S.global_status.

Otherwise long status strings (e.g. Ssl_cipher_list) won't fit
and trigger a data truncation warning (an error in the strict mode)
2026-04-28 16:05:51 +02:00
Anway Durge
a96ebfcb2a MDEV-39126: Feedback plugin to use /etc/os-release
Update prepare_linux_info() to use /etc/os-release
(PRETTY_NAME) as the primary source for OS detection.

Retain fallback support for /etc/lsb-release and
/etc/*-release for older systems.

Add MTR regression test feedback_os_release.

Signed-off-by: Anway Durge <124391429+itzanway@users.noreply.github.com>
2026-04-22 09:20:15 +10:00
Mikhail Pochatkin
cbcff6324a MDEV-39173 Replace sprintf with snprintf, remove deprecated pragma
Remove the unscoped #pragma GCC diagnostic ignored
"-Wdeprecated-declarations" from include/violite.h and replace all
sprintf/vsprintf calls with snprintf/vsnprintf across the codebase.

Where possible, pass actual buffer sizes as function parameters
instead of using hardcoded constants or recomputing strlen().
Notable API changes:
- get_date(): added to_len parameter for buffer size
- nice_time(), end_timer() in client/mysql.cc: added buff_size
- generate_new_name(): added name_size parameter
- calc_md5(): added buffer_size parameter (fixes off-by-one)
- MD5_HASH_TO_STRING macro: added _size parameter
- Added MYSQL_UDF_MAX_RESULT_LENGTH constant in mysql_com.h

Also fixed a pre-existing bug in sql/rpl_mi.cc where the ellipsis
"..." was written to the wrong buffer (dbuff instead of buff).

Vendored code is excluded: extra/readline, extra/wolfssl,
wsrep-lib, libmariadb, storage/mroonga/vendor, zlib.
2026-04-16 19:00:12 +10:00
Vladislav Vaintroub
330f9b133f MDEV-28115 Hashicorp MTR tests aren't runnable on WIndows
- Fixed detection of "vault" utility
- Removed include/not_windows.inc from common include
- On Windows, skip 2 tests that rely on "grep"
- in mtr, set PATH to include mtr plugin directory (this is necessary
  to load vcpkg dependencies)
2026-03-25 19:36:23 +01: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
Sergei Golubchik
12578d8a69 MDEV-38604 fix SP execution too 2026-01-26 23:15:34 +01:00
Sergei Golubchik
b6d0e23d76 MDEV-38365 SHA2 auth plugin crash on large packets
use my_safe_alloca() as the key_len comes directly from the client

Reported by Pavel Kohout, Aisle Research, www.aisle.com
2026-01-23 14:31:12 +01:00
Sergei Golubchik
cb31d7536b MDEV-38604 Assertion `thd->utime_after_query >= thd->utime_after_lock' failed in query_response_time_audit_notify on 2nd execution of SP with query cache
even when PS is served from a query cache, thd->utime_after_query
must be updated.

also, backport the assert from 11.8
2026-01-23 12:15:34 +01:00
Oleg Smirnov
f2b48e565c MDEV-38574 Rename cloning functions of class Item and descendants
Rename cloning methods of class Item and its descendants
in the following way:

   (from)            (to)
do_build_clone  -> deep_copy
   build_clone  -> deep_copy_with_checks

do_get_copy  -> shallow_copy
   get_copy  -> shallow_copy_with_checks

to better reflect their functionality.

Also make Item::deep_copy() and shallow_copy() protected.
Outside users should call deep_copy_with_checks()
and shallow_copy_with_checks().
2026-01-22 12:57:48 +01:00
Marko Mäkelä
08c57c5ebf MDEV-37600 fixup: clang 21 -Wunterminated-string-initialization 2026-01-20 08:55:59 +02:00
Vladislav Vaintroub
f2cb54849f MDEV-38203 fix build error on Windows 2026-01-19 16:36:55 +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
b998e3a7b9 MDEV-38203 Hashicorp plugin lets keys timeout and doesn't use cached keys on vault errors
* let use_cache_on_timeout apply to other errors
* enable use_cache_on_timeout by default and deprecate it
* increase cache_timeout to max and deprecate it
* change it from long to portable longlong
* delete both in 13.3
2026-01-14 19:44:30 +01:00
Tony Chen
4e674a20c4 Simplify event filtering logic in server_audit plugin
Replace if-else chain with a single bitwise AND check when filtering query
events by type (DDL, DML, DCL, etc.).

The removes the need for the goto statements.

Additionally, we remove the orig_query variable as it served no purpose.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license
2026-01-14 16:39:23 +01:00
Marko Mäkelä
678ff03ee7 Merge 10.11 into 11.4 2026-01-02 11:53:09 +02:00
Marko Mäkelä
8fab129382 Merge 10.6 into 10.11 2026-01-02 11:06:05 +02:00
Sergei Golubchik
635559a2ad MDEV-38375 audit plugin implements its own (simple) SQL parser
remove the parser, use thd_sql_command(thd)
2025-12-26 23:49:47 +01:00
Marko Mäkelä
12e93b97e1 Merge 10.11 into 11.4 2025-11-11 10:34:33 +02:00
Vladislav Vaintroub
6fea5712d1 MDEV-3799 Windows WITH_ZLIB=bundled build errors with hashicorp_key_management
We compile curl with vcpkg. vcpkg prefers dependencies of the vcpkg
package to come from vcpkg as well. We break its logic by setting
and ZLIB_LIBRARY in cmake/zlib.cmake to the static library that we
compile outselves. This vcpkg check is not critical or needed
when shared libraries are used.

As a workaround, set CMAKE_DISABLE_FIND_PACKAGE_ZLIB when compiling
hashicorp_key_management, in this case vcpkg skips the zlib check.
2025-10-30 16:46:33 +01:00
Sergei Golubchik
bcb77590f0 cleanup: CREATE_TYPELIB_FOR() helper
(cherry picked from commit d046aca0c7)
2025-10-25 00:19:11 +07:00
Yuchen Pei
4586b96c29 Merge branch '10.11' into 11.4 2025-10-15 19:29:55 +11:00
Sergei Golubchik
2f5bad2f2b bump inet4 maturity to stable 2025-10-14 15:04:23 +02:00
Marko Mäkelä
5b72e95a8c MDEV-37600 fixup: GCC 15 -Wunterminated-string-initialization 2025-10-03 08:50:33 +03:00
Marko Mäkelä
e8ef8c0055 Merge 10.11 into 11.4 2025-09-24 13:40:09 +03:00
Vladislav Vaintroub
d098e61542 MDEV-37600 - fix error message formatting after backporting
MariaDB 11.4 does not understand %iE modifier yet.
Use %M instead
2025-09-21 13:14:24 +02:00
Vladislav Vaintroub
09a6249958 MDEV-37600 Backport MDEV-37339 errors about caching_sha2_password on server startup (WolfSSL)
With WolfSSL, the plugins is statically compiled, and enabled,
and defaults to autogenerating ssl keys, which was left unimplemented.
Thus, it spits out some [ERROR] on every startup.

Fixed by removing a couple some ifdefs. Allowed tcp_nossl to run on
Windows.

As WolfSSL is missing some APIs with FILE*, use related API that
accept BIO
, i.e
- BIO_new_file() instead of fopen()
- BIO_free instead of fclose()
- PEM_write_bio_PrivateKey() instead of PEM_write_PrivateKey()
- etc

A note about BIO and error reporting:
BIO_new_file sets the errno, therefore FILE_ERROR macro
produces good expected error messages, while SSL_ERROR unfortunately
creates something incomprehensible. Thus, FILE_ERROR is left in place
where it was used previously (fopen errors)

Curiously, removing APIs with FILE*, solves another bug MDEV-37343,
where server on Windows dies with obscure message as plugins tries to use
this function. OpenSSL_Applink supposed to be official solution against
such problems, but I could not get it to work properly, no matter how
much I tried. Avoiding APIs with FILE* in first place works best
2025-09-21 13:13:59 +02:00
Sergei Golubchik
c0233a09ee MDEV-37600 Backpoint MDEV-9804 Implement a caching_sha2_password plugin
but without caching
2025-09-21 13:13:30 +02:00
Arcadiy Ivanov
62b21714d0 Reproducible test case for MDEV-37434
Add debug logging to help with tracing

Add the fix
2025-09-18 18:01:33 +02:00
Marko Mäkelä
acd3db4e44 Merge 10.11 into 11.4 2025-09-16 17:01:39 +03:00