Commit graph

1,803 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
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
Oleksandr Byelkin
15b1426c3a Merge branch '10.11' into bb-11.4-release 2025-09-15 16:17:33 +02:00
Sergei Golubchik
7d08434f67 MDEV-30849 Hashicorp Plugin: enable key version caching by default
set hashicorp_key_management_cache_version_timeout=60s by default

increase hashicorp_key_management_cache_timeout to 24h by default,
because key values should never change, but we don't want to remove
a variable for compatibility reasons
2025-09-15 11:00:02 +02:00
Tony Chen
9b8268198c Fix server_audit rwlock PS instrumentation
Commit 1d80e8e updated lock_operations to a rwlock from a mutex but didn't
update the PS instrumentation setup accordingly.

We update the PS setup accordingly so the lock is correctly instrumented in
performance_schema.rwlock_instances.

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. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2025-09-12 23:53:47 +04:00
Michael Widenius
5a35fff422 Fixed typos
- Some of the typos was because a Russian character was
  accidentally used instead of an ascii one.
2025-09-04 18:08:39 +03:00
Sergei Golubchik
c4ed889b74 Merge branch '10.11' into 11.4 2025-07-28 19:40:10 +02:00
Sergei Golubchik
c05b1fe2c2 MDEV-21654 binary library file pam_mariadb_mtr.so installed among test data files
lintian complains:
arch-dependent-file-in-usr-share
arch-independent-package-contains-binary-or-object
2025-07-17 09:18:18 +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
Svante Signell
72d2b7697d MDEV-12305 FTBFS on hurd-i386 due to PATH_MAX
Hurd doesn't create PATH_MAX due its dogmatic standard
approach.

ref: https://www.gnu.org/software/hurd/hurd/porting/guidelines.html#PATH_MAX_tt_MAX_PATH_tt_MAXPATHL

Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069094
2025-06-18 09:11:28 +10:00
raghunandanbhat
bff9b1e472 MDEV-36851: COALESCE() returns nullable column while IFNULL() does not
Nullability is decided in two stages-

1. Based on argument NULL-ness

Problem:
- COALESCE currently uses a generic logic- "Result of a function
  is nullable if any of the arguments is nullable", which is wrong.
- IFNULL sets nullability using second argument alone, which incorrectly
  sets the result to NULL even when first argument is not null.

Fix:
- Result of COALESCE and IFNULL is set to NULL only if all arguments are
  NULL.

2. Based on type conversion safety of fallback value

Problem:
- The generic `Item_hybrid_func_fix_attributes` logic would mark the
  function's result as nullable if any argument involved a type
  conversion that could yield NULL.

Fix:
- For COALESCE and IFNULL, nullability is set to NOT NULL if the first
  non-null argument can be safely converted to function's target return
  type.
- For other functions, if any argument's conversion to target type could
  result in NULL, the function is marked nullable.

Tests included in `mysql-test/main/func_hybrid_type.test`
2025-06-12 16:58:52 +05:30
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
Marko Mäkelä
3da36fa130 Merge 10.6 into 10.11 2025-05-26 08:10:47 +03:00
Daniel Black
b9a20752a9 MDEV-36337 auth_ed25519 correct UDF pointers for is_null/error
Shows up on test plugins.auth_ed25519.

There isn't the import to define uchar so left as unsigned char.
2025-05-21 09:47:55 +02:00
Oleksandr Byelkin
a8d4642375 Merge branch '10.11' into 11.4 2025-04-26 10:53:02 +02:00
Oleksandr Byelkin
20b818f45e Merge branch '10.6' into 10.11 2025-04-21 11:23:11 +02:00
Oleksandr Byelkin
a135551569 Merge branch '10.5' into 10.6 2025-04-21 10:43:17 +02:00
Alexey Botchkov
fbec528cbb MDEV-36245 review changes
Closes #3874
2025-04-19 10:16:19 +02:00
Tony Chen
8c6b0d092a MDEV-36245 Long server_audit_file_path causes buffer overflow
Limit size of server_audit_file_path value

Currently, the length of this value is not checked and can cause a buffer
overflow if given a long file path specifying a directory.

In file_logger:logger_open(), there is a check:
```
  if (new_log.path_len+n_dig(rotations)+1 > FN_REFLEN)
    // handle error
```

As n_dig(rotations) may return up to 3, this inherently limits the file path to
FN_REFLEN - 4 characters.

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. I
am contributing on behalf of my employer Amazon Web Services, Inc.
2025-04-19 09:59:29 +02:00
Dave Gosselin
15fd232da4 MDEV-36235 Incorrect result for BETWEEN over unique blob prefix
Disallow range optimization for BETWEEN when casting one of the arguments
from STRING to a numeric type would be required to construct a range for
the query.

Adds a new method on Item_func_between called can_optimize_range_const
which allows range optimization when the types of the arguments to BETWEEN
would permit it.
2025-04-18 12:44:17 -04:00
Julius Goryavsky
1a013cea95 Merge branch '10.6' into '10.11' 2025-04-16 03:34:40 +02:00
Julius Goryavsky
88dfa6bcee Merge branch '10.5' into '10.6' 2025-04-15 01:49:48 +02:00
Oleksandr Byelkin
ba34657cd2 MDEV-35238 (MDEV-34922) Wrong results from a tables with a single record and an aggregate
The problem is that copy function was used in field list but never
copied in this execution path.

So copy should be performed before returning result.

Protection against uninitialized copy usage added.
2025-04-14 10:47:27 +02:00
Sergei Golubchik
60638a84e8 MDEV-36586 USER_STATISTICS.BUSY_TIME is in microseconds
the bug was that MDEV-35720 missed two lines

followup for 95975b921e
2025-04-13 12:19:56 +02:00
Daniel Black
93ea4f29a4 MDEV-36347 UBSAN: plugins.auth_v0100 - runtime error: call to function do_auth_0x0100
through pointer to incorrect function type.

Redoing a new plugin interface for an obsolete protocol was
too much so we just remove the UBSAN testing on the function.

It wasn't possible to just disable funtion-type-mismatch
2025-04-07 11:04:53 +02:00
Marko Mäkelä
f5bd250f5b Merge 10.11 into 11.4 2025-03-28 13:55:21 +02:00