Commit Graph

1787 Commits

Author SHA1 Message Date
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
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
2025-09-16 17:01:39 +03:00
Oleksandr Byelkin
15b1426c3a Merge branch '10.11' into bb-11.4-release
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
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
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
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 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
Marko Mäkelä
ab0f2a00b6 Merge 10.6 into 10.11 2025-03-27 08:01:47 +02:00
Julius Goryavsky
e3d7d5ca26 Merge branch '10.5' into '10.6' 2025-02-27 04:02:33 +01:00
Alexander Barkov
583b39811c MDEV-35620 UBSAN: runtime error: applying zero offset to null pointer
in _ma_unique_hash, skip_trailing_space, my_hash_sort_mb_nopad_bin and my_strnncollsp_utf8mb4_bin

UBSAN detected the nullptr-with-offset in a few places
when handling empty blobs.

Fix:
- Adding DBUG_ASSERT(source_string) into all hash_sort() implementations
  to catch this problem in non-UBSAN debug builds.
- Fixing mi_unique_hash(), mi_unique_comp(),
  _ma_unique_hash(), _ma_unique_comp() to replace NULL pointer to
  an empty string ponter..

Note, we should also add DBUG_ASSERT(source_string != NULL) into
all implementations of strnncoll*(). But I'm afraid the patch
is going to be too long and too dangerous for 10.5.
2025-02-03 16:45:02 +04:00
Sergei Golubchik
7d657fda64 Merge branch '10.11 into 11.4 2025-01-30 12:01:11 +01:00
Sergei Golubchik
e69f8cae1a Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
Marko Mäkelä
98dbe3bfaf Merge 10.5 into 10.6 2025-01-20 09:57:37 +02:00
Alexander Barkov
e551070ba4 MDEV-35468 UUID primary key filtering return incorrect results
UUID::cmp() correctly compared:
- two swapped v1 UUIDs
- two non-swapped v6 UIDs

but v1 vs v6 were not compared correctly.

Adding a new method cmp_swap_noswap() and using
it in UUID::cmp() to compare two value of different swapness.
2025-01-17 11:09:12 +04:00
Alexander Barkov
3158af03bd A cleanup for MDEV-35427: recording new type_uuid_ps.result
Forgot to "git add" it in the previous commit.
2025-01-16 21:52:55 +04:00
Alexander Barkov
c8ef86cc8b A cleanup for MDEV-35427 to avoid dependency from the current date
Adding a "SET timestamp" command before the test body.
2025-01-16 21:04:39 +04:00
Dave Gosselin
86b257f870 MDEV-35632 HandlerSocket uses deprecated C++98 auto_ptr
Change uses of auto_ptr to unique_ptr
2025-01-16 11:43:27 -05:00
Alexander Barkov
f4e999d753 MDEV-35427 Assertion `is_null() >= item->null_value' failed in Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null on EXECUTE
This problem was earlier fixed by MDEV-25593.
Adding a test case only.
2025-01-15 13:18:12 +04:00
Sergei Golubchik
f1a7693bc0 Merge branch '10.11' into 11.4 2025-01-14 23:45:41 +01:00
Sergei Golubchik
221aa5e08f Merge branch '10.6' into 10.11 2025-01-10 13:14:42 +01:00
Sergei Golubchik
9b941dc51f MDEV-34494 restore broken feedback plugin
it must report feedback_server_uid otherwise report stats won't work.
2025-01-09 10:00:36 +01:00
Marko Mäkelä
17f01186f5 Merge 10.11 into 11.4 2025-01-09 07:58:08 +02:00
Marko Mäkelä
420d9eb27f Merge 10.6 into 10.11 2025-01-08 12:51:26 +02:00