Commit Graph

204123 Commits

Author SHA1 Message Date
Otto Kekäläinen
5ed3668890 Deb: Format files with debputy reformat --style black
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
This formats and sorts the files the same way they are in the official
Debian packaging, making it easier to compare the files in Debian vs
upstream using commands such as `git difftool --dir-diff main --
debian`. Comparing the contents at least once a year is important in
ensuring all packaging improvements get their way into both Debian
official and upstream Debian packaging.

See https://salsa.debian.org/mariadb-team/mariadb-server/-/tree/debian/latest/debian

The formatting done by `debputy reformat --style black` is basically the
same as running `wrap-and-sort -vast`.

There are no functional changes, this is a pure formatting change.

This is intentionally done on the `main` branch in MariaDB. The stable
release branches are unlikely to ever get any changes in the
`debian/control` file, and thus formatting or maintaining it is
irrelevant. The merges from stable releases to latest `main` should not
bring any `debian/control` file changes, as adding or removing
dependencies, changing Debian compat levels or other changes are
invasive and shouldn't be done in stable releases at all.
2025-12-23 13:42:04 +11:00
haibo
068a095750 MDEV-36737: Research and Estimation for Adapting VIDEX to MariaDB
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
VIDEX is a Disaggregated and Extensible Virtual Index Engine designed
to perform efficient and accurate what-if analysis for tasks such as
index recommendation.

Fix template linking error for gcc

debian: Add packaging for the VIDEX plugin

This commit adds the necessary files to build `mariadb-plugin-videx` as a separate Debian package.

- Add `COMPONENT videx-engine` to CMakeLists.txt to register the plugin.
- Define the `mariadb-plugin-videx` package in debian/control.
- Create `debian/mariadb-plugin-videx.install` to include the plugin .so and .cnf files.

debian: fix indent in debian/control

fix bugs from  empty table

videx: fix RPM autobake by adding CPACK summary/description
2025-12-22 10:21:29 +11:00
Monty
4a01157492 Fixed mtr test that fails with valgrind build and max_session_mem_used
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
perfschema.misc_session_status and main.max_session_mem_used fixed by
including not_valgrind_build.inc
2025-12-20 18:15:24 +02:00
Andrei Elkin
84fa008d25 MDEV-38254 replicated temporary tables must not be accessed by start_new_trans
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
The mdev is fixed by 7f3145e06 commit.
2025-12-19 18:19:41 +02:00
Andrei Elkin
7f3145e068 MDEV-38212 MDEV-37686 Breaks Parallel Replication
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
Instead of `NULL`ifying of this member a finer approach is taken to
screen the replicated temporary tables from the slave applier
when it runs within `start_new_trans` context.

For that *all* access critical `THD::{has,lock,unlock}_temporary_tables`
functions are made to check possible `start_new_trans` condition.
This measure forces `start_new_trans` executing slave thread to always take
the normal thread access path to a temporary table repository.

This commit also unifies with sql/temporary_tables.cc checking of the
current thread is slave with usage of THD::rgi_slave instead of
THD::slave_thread (last time chosen by MDEV-33426).

Tested with rpl.create_or_replace_mix2 of GTT feature branch.
2025-12-19 15:08:24 +02:00
Andrei Elkin
8782227eb1 Revert "MDEV-37686 rpl.create_or_replace_mix2 fails in MDEV-35915 branch"
This reverts commit 3241798214.
Due to MDEV-38212.
2025-12-19 15:08:24 +02:00
Georgi Kodinov
3a08a8e3d2 Display the exact amount of data updated by mariadb-secure-installation
Some checks are pending
Build on Windows ARM64 / build (push) Waiting to run
2025-12-19 11:59:26 +02:00
Otto Kekäläinen
69ee922c1c Improve output from mariadb-secure-installation to be more honest
The script is likely misleading to users stating 'SUCCESS' about things
it didn't do anything about, leading to false sense of security. Improve
the output to be more clear about what it is doing or is not doing.
2025-12-19 11:59:26 +02:00
Raghunandan Bhat
d936d36d4f MDEV-30847: HashiCorp Plugin: Provide cache flush for key rotation
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
Introduces `FLUSH HASHICORP_KEY_MANAGEMENT_CACHE` command to flush the
cached keys in the HashiCorp Key Management plugin, enabling rotation of
encryption keys without needing to restart the server.

The new `INFORMATION_SCHEMA.HASHICORP_KEY_MANAGEMENT_CACHE` table lists
the key id and key version from the latest version cache. The table's
content can be viewed using `SHOW HASHICORP_KEY_MANAGEMENT_CACHE` or
queried directly.

Executing the `FLUSH` command requires `RELOAD` privilege and access to
INFORMATION_SCHEMA table requires `PROCESS` privilege.

Bugfix (squashed):
MDEV-38111: SIGSEGV when multiple servers use the same Vault KV storage for encrypted tables

Problem:
  A data race between InnoDB background threads reading the cached keys
  and the thread executing FLUSH command clearing it without acquiring
  a lock. This non-synchronized memory write caused InnoDB threads that
  were concurrently reading the cache to access freed memory, leading to
  a crash.

Fix:
  Acquire the lock before clearing the latest version cahce. This
  ensures the cache clearing operation is serialized, preventing
  concurrent access and resolving the data race.
2025-12-16 17:47:34 +05:30
Otto Kekäläinen
5879c85f50 Fix misc spelling in MariaDB Server repository
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
This is a combined patch of various spelling fixes originally done in
Debian.

* Fix misc typos in MariaDB Server

* Fix spelling of 'allows one to'

  Fix the following Lintian nags introduced in commit
  c8d040938a:

  I: mariadb-backup: spelling-error-in-binary "allows to" "allows one to" [usr/bin/mariadb-backup]
  I: mariadb-server-core: spelling-error-in-binary "allows to" "allows one to" [usr/sbin/mariadbd]
  I: mariadb-test: spelling-error-in-binary "allows to" "allows one to" [usr/bin/mariadb-client-test-embedded]
  I: mariadb-test: spelling-error-in-binary "allows to" "allows one to" [usr/bin/mariadb-test-embedded]
  I: mariadb-test: spelling-error-in-binary "allows to" "allows one to" [usr/bin/test-connect-t]
2025-12-10 18:08:12 +04:00
Rex Johnston
e85bc65918 MDEV-37220 Allow UPDATE/DELETE to read from a CTE
We extend from the SQL standard to match the functionality of other
databases that allow the inclusion of a CTE definition prior to update
and delete statements.

These CTEs are currently read only, like other derived tables, so
cannot have their columns updated in updates set clause, nor have rows
removed in the delete statement.

Approved by: Oleksandr Byelkin (sanja@mariadb.com)
2025-12-04 07:42:23 +12:00
Monty
797f50d107 Removed not used members in class POSITION
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
Removed members:
- records_after_filter
- prev_record_reads
2025-11-25 10:25:01 +02:00
Monty
1e8dddbdbb Fixed failing mysqldump test when there is no internet connection
When no internet, we get a different error from mariadb-dump for unkown
hosts.
2025-11-25 10:25:01 +02:00
bsrikanth-mariadb
f4318f3f3b MDEV-38120: Move Json_string and Json_saved_parser_state into sql_json_lib.h
Move classes Json_string, and Json_saved_parser_state from
opt_histogram_json.cc to the newly created file sql_json_lib.h
Additionally, make the function json_unescape_to_string public earlier
defined as static in opt_histogram_json.cc, by
adding the declaration in sql_json_lib.h

Needed this change so that, the classes and functions can be reused in
other pieces of the code.
2025-11-24 17:45:51 +05:30
Sergei Golubchik
809e6f4195 12.3 branch 2025-11-22 22:08:38 +01:00
Sergei Golubchik
b15d1adf85 Merge branch '12.2.1' into 12.2 2025-11-22 19:41:27 +01:00
Sergei Golubchik
277c30fde3 bump the maturity 2025-11-22 19:40:53 +01:00
Daniel Bartholomew
c6f02d6a88
bump the VERSION 2025-11-21 02:44:26 -05:00
Sergei Golubchik
144dead882 (clang20) error: moving a temporary object prevents copy elision 2025-11-18 22:18:59 +01:00
Sergei Golubchik
ddd3a612cf ctype-ascii.h:110:27: runtime error: applying non-zero offset 4 to null pointer
when this->get_name() is {0,0}
2025-11-18 21:20:31 +01:00
Sergei Golubchik
0af24548e5 runtime error: inf is outside the range of representable values of type 'unsigned long long' 2025-11-18 21:04:57 +01:00
Sergei Golubchik
8d6699db90 runtime error: shift exponent 32 is too large for 32-bit type 'int' 2025-11-18 20:58:03 +01:00
Sergei Golubchik
9161270a11 Merge branch '12.1' into 12.2 2025-11-18 15:06:52 +01:00
Rucha Deodhar
8abdcba534 MDEV-37082: Sig 11 in json_normalize_sort
Analysis:
json_valid() does not call any function recursively so insertion in the
table works ok. Since the depth of json is 5000, json_normalize()
recursively calls json_normalize_sort(), json_norm_to_string() and
json_norm_value_free() and we hit the stack limit.
Fix:
Get rid of the recursive nature of the functions and make them iterative.
This way we will never hit stack limit for bigger depths.
2025-11-18 18:36:17 +05:30
Sergei Golubchik
70117463f0 Merge branch '11.8' into 12.1
Some checks failed
Build on Windows ARM64 / build (push) Has been cancelled
2025-11-13 16:46:01 +01:00
Sergei Petrunia
1f7446efdc MDEV-37422: SIGSEGV / Assert for vcol substitution in GROUP BY WITH ROLLUP
Variant 2:
Do not do virtual column substitution in GROUP BY when WITH ROLLUP is
present.

Approved by: Yuchen Pei <ycp@mariadb.com>
2025-11-13 16:45:36 +01:00
Sergei Golubchik
cd3df7142d remove unused new modes constants 2025-11-13 16:38:56 +01:00
Oleg Smirnov
5f845854fb MDEV-36761 Remove @@new_mode=FIX_INDEX_STATS_FOR_ALL_NULLS in 12.1
Remove the FIX_INDEX_STATS_FOR_ALL_NULLS flag from @@new_mode.
The new behavior is now always on.
2025-11-13 22:18:13 +07:00
Sergei Golubchik
a74edc42d0 MDEV-38068 Query doesn't delete all data it should after update to 11.8.4
a fix for MDEV-15990 has unintentionally added
HA_EXTRA_REMEMBER_POS/HA_EXTRA_RESTORE_POS on the code path for normal,
not versioned, deletes.

Let's restore the old logic.

followup for 8001679af6
2025-11-13 09:40:50 +01:00
Oleksandr Byelkin
a0bdb3b7d0 fix version 2025-11-07 17:22:40 +01:00
Oleksandr Byelkin
c3398a0532 Merge branch '11.8' into mariadb-11.8.4 2025-11-07 11:03:57 +01:00
Daniel Bartholomew
db02a70725
bump the VERSION 2025-11-06 12:31:11 -05:00
Oleksandr Byelkin
fd15fd2765 Merge branch 'bb-12.1-release' into bb-12.2-release 2025-11-06 07:29:30 +01:00
Oleksandr Byelkin
ba00960fda Merge branch 'bb-11.8-release' into bb-12.1-release 2025-11-05 08:58:12 +01:00
Sergei Golubchik
c21d462e6a Merge branch 'bb-11.4-serg' into bb-11.8-serg 2025-11-04 18:27:52 +01:00
Dave Gosselin
101346c3dc MDEV-37905: UNCACHEABLE_RAND inconsistently set on unions
We need to ensure that all the unions are marked as UNCACHEABLE_RAND in
cases like:
  select * from t1 where 1 in (select 1 union select 2 union select RAND());
2025-11-04 08:47:54 -05:00
Sergei Golubchik
aa6a2e6bf0 MDEV-37345 sequences and prelocking (11.4 version)
table->pos_in_table_list is problematic, it can become
dangled when an SP is reparsed. Let's avoid it and directly
prefer TABLEs where a sequence is ready for inserts.

followup for 516f68af9e
2025-11-04 13:44:39 +01:00
Sergei Golubchik
f230c0ff6e Merge branch '10.11' into 11.4 2025-11-04 13:44:16 +01:00
Sergei Golubchik
5ce9a03602 Merge branch '11.4' into 11.8 2025-11-04 12:39:27 +01:00
Sergei Golubchik
152ed78d49 MDEV-37345 sequences and prelocking (11.4 version)
table->pos_in_table_list is problematic, it can become
dangled when an SP is reparsed. Let's avoid it and directly
prefer TABLEs where a sequence is ready for inserts.

followup for 516f68af9e
2025-11-04 01:05:25 +01:00
Sergei Golubchik
d198be392b fix nullptr-with-nonzero-offset UB 2025-11-03 19:56:46 +01:00
Sergei Golubchik
0c94001a32 fix merge test to restore the environment
include/test_db_charset_latin1.inc should be paired with
include/test_db_charset_restore.inc

also fix end-of-version test markers
2025-11-03 16:56:29 +01:00
Sergei Golubchik
1093a2f3b8 Merge branch '10.11' into 11.4 2025-11-03 14:23:51 +01:00
Sergei Golubchik
cb0d6dd835 fix rpm upgrade tests after MDEV-37726
MDEV-37726 moved wsrep-start-position to INSTALL_RUNDATADIR
and made the latter to be created by systemd-tmpfiles.

Now postin scriptlet has to run systemd-tmpfiles explicitly
to make sure INSTALL_RUNDATADIR exists before restarting
the server.

followup for 649216e70d
2025-11-03 14:00:16 +01:00
Sergei Golubchik
9dce783911 fix spider/bugfix.mdev_22979 test
* remove the file to be --repeat friendly
* specify the correct defaults-group-suffix. Spider doesn't use the
  conventional .1 group, so MYSQLD_CMD skips a lot of config options,
  in particular it doesn't read --tmpdir and creates files in /tmp
2025-11-03 13:59:36 +01:00
Oleksandr Byelkin
06cce62200 Merge branch '12.1' into bb-12.2-release 2025-11-02 18:08:29 +01:00
Sergei Petrunia
240b4e83e0 MDEV-37913: disable_index_merge_plans causes SELECT data loss when more than 100 ORs
(Variant 2)
SEL_TREE* tree_or(SEL_TREE *X, SEL_TREE *Y) tries to conserve memory by
reusing object *X for the return value when possible.

MDEV-34620 has added logic to disable construction of index_merge plans
for N-way ORs with large N. That logic interfered with object reuse logic:

for the parameters of:
X = SEL_TREE{ trees=[key1_treeA, key2_treeB]}
Y = SEL_TREE{ trees=[key1_treeC]}

we would decide to reuse object X.
For key1, we would produce key_or(key1_treeA, key1_treeC)
but key2_treeB would be just left there.
Then, we would construct a range scan from key2_treeB.

Fixed by moving the "disable building index_merge plans" logic into a
location where it would not interfere with object reuse logic.
2025-11-01 11:04:46 +01:00
Oleg Smirnov
aa70eeac2c MDEV-36761: Put NULL-aware cardinality estimation under new_mode flag
The NULL-aware index statistics fix is now controlled by the
FIX_INDEX_STATS_FOR_ALL_NULLS flag and disabled by default
for preserving execution plan stability in stable versions.

To enable:
  SET @@new_mode = 'FIX_INDEX_STATS_FOR_ALL_NULLS';

Or via command line:
  --new-mode=FIX_INDEX_STATS_FOR_ALL_NULLS

Or in configuration file:
  [mysqld]
  new_mode=FIX_INDEX_STATS_FOR_ALL_NULLS

`all_nulls_key_parts` bitmap is now calculated at set_statistics_for_table()
2025-10-31 19:47:30 +07:00
Sergei Golubchik
292bab3565 cleanup: Sp_caches::sp_caches_swap()
remove the fix for MDEV-25243. It's no longer needed, because
a routine can no longer be re-parsed in the middle of a statement.
2025-10-28 17:49:51 +01:00
Sergei Golubchik
78e474b1a7 cleanup: sp_cache_flush_obsolete
it was only truly used in one place, where it needed to compare
its arguments before removing an entry from the cache. in the second
place it was used, the comparison was redundant, it was only
called to remove, not to compare.

let's replace it with a function that just removes.
2025-10-28 17:49:51 +01:00