Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View


Categories: connectors experimental galera main
Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

connectors experimental galera main
Michal Schorm
MDEV-5479 Prevent stealing Unix socket of running instance

When mysqld starts up and the configured Unix socket path is
already in use by another process, network_init()
unconditionally unlink()s the active socket file. This
silently breaks the other process's ability to accept local
connections. The typical scenario is two MariaDB instances
configured with the same socket path but different TCP ports,
but any process listening on that path is affected.

Root cause: the call (void) unlink(mysqld_unix_port) in
network_init() removes an existing socket file without
checking whether another process is actively listening on it.
Notably, the bind() error handler immediately following the
unlink already warns about another running server -- but this
message could never trigger because the unconditional
unlink() removed the socket before bind() had a chance to
fail.

Fix: add unlink_socket_or_abort() that, before unlinking an
existing socket file, attempts to connect() to it:
- If socket() fails, abort startup (system resource issue).
- If connect() succeeds, another process is actively using
  the socket. Abort startup with an error message.
- If connect() fails with ECONNREFUSED or ENOENT, the
  socket is stale from a previous unclean shutdown. Proceed
  with unlink() as before.
- Any other connect() errno aborts startup to fail safe.
- If the file exists but is not a socket (S_ISSOCK check),
  remove it to preserve previous behavior.

connect() was chosen over flock()-based advisory locking
because flock() requires managing a separate lock file
alongside the socket (creation, cleanup, and handling of
orphaned lock files), and does not work reliably on network
filesystems. connect() probes the socket directly with no
extra files and no NFS dependency. This is the same approach
PostgreSQL uses for socket conflict prevention.

Co-Authored-By: Claude AI <[email protected]>
ParadoxV5
MDEV-39240 10.6-11.4 Replication Allows Full Range for 32-bit Unsigned Timestamps

Row-based Replication did not validate serialized timestamps,
which allows (pre-11.5) slaves to accept “negative” timestamps
(between the Year 2038 limit and the 4-byte limit) via replication.
In particular, a completely valid source of those timestamps is 11.5.1+
masters, where MDEV-32188 has increased the upper limit of
timestamps to Year 2106 by utilizing this previously invalid range.

This commit fills in this pre-processing:
swap the Year 2106 max with the Year 2038 max,
or throw an “Incorrect timestamp value” error for the others.

Reviewed-by: Brandon Nesterenko <[email protected]>
Daniel Black
MDEV-34902: debian-start erroneously reports issues

Remove the complexity of check_for_crashed_tables
by removing it all together. When check_for_crashed_tables
was written there was a desire to recover MyISAM tables.

With Aria being default from 10.4 for system tables,
and all non-MyISAM engines being able to do crash
recovery there isn't the need to autocheck as part
of a system service.

With check_for_crashed_tables removed there is no need
for a mailx package recommendation.
Sergei Golubchik
MDEV-17256 Decimal field multiplication bug

Fix multiplication correctly - by truncating long factors before
multiplication. Not both equally, but in a way that minimizes the
error.

Add more multiplication tests to verify that now multiplication
works correctly.
Alexandru Diaconu
MDEV-38853 Guard VALIDITY_ASSERT in Json_writer for NDEBUG builds

Guard VALIDITY_ASSERT in Json_writer::add_unquoted_str() and
Json_writer::add_str() with !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST)
to avoid references to debug-only symbols in release builds.

Reported-by: Bjarne D Mathiesen
Original-patch-by: Bjarne D Mathiesen
(from JIRA / MacPorts PR28680).
Sergei Golubchik
MDEV-39154 wrong OOM handling in collect_grouping_fields()

correct (and document) the return values for collect_grouping_fields()
Varun Deep Saini
MDEV-18318 Unit tests for the Json_writer

Add 104 TAP unit tests for the Json_writer class covering:

- Invalid JSON detection (unnamed values in objects, named values
  in arrays, mismatched open/close)
- Output verification for all value types (strings, integers,
  unsigned integers, booleans, null, doubles, sizes)
- Edge cases: LLONG_MAX/MIN, ULLONG_MAX, special doubles (0.0,
  -0.0), Latin-1 and UTF-8 mb4 encoded strings, embedded NUL
  bytes in keys and values, duplicate key names
- add_member(name, len) explicit key length
- Single-line formatting helper including long-element fallback
  and embedded-NUL disable behavior
- Nested structures (objects in objects, arrays of objects, mixed)
- RAII wrappers (Json_writer_object, Json_writer_array) including
  ulonglong add overload preserving unsigned range
- String_with_limit truncation behavior
- Json_writer size limit enforcement with exact truncation count
- add_size formatting (bytes, Kb, Mb) with boundary tests
- Positive-path test for add(name, value, num_bytes) overload

Also fix a missing my_writer NULL guard in
Json_writer_object::add(const char*, const char*, size_t)
which would crash when used with a NULL writer.

Harden Single_line_formatting_helper against embedded NUL bytes:
on_add_member() now rejects keys containing NUL, and on_add_str()
disables single-line mode and flushes when a value contains NUL.

Signed-off-by: Varun Deep Saini <[email protected]>
Signed-off-by: Varun Deep Saini <[email protected]>
Sergei Golubchik
MDEV-37640 fix test for --view

followup for 05f901893382
Sergei Golubchik
MDEV-30255 0 changed to 0.0 caused by DISTINCT and UNION ALL

Revert "MDEV-17256 Decimal field multiplication bug." (57898316b6fb)

It removes zero truncation from decimal_mul() and fixes
reported symptoms.

But reintroduces multiplication bug.
Aquila Macedo
systemd: protect cgroups in unit templates

Set ProtectControlGroups=true in mariadb.service and [email protected] to
make /sys/fs/cgroup read-only for the service.

Improves systemd-analyze security while keeping auth_pam (PAMv2)
working.
Sergei Golubchik
MDEV-30354 fix test for --view

followup for 0b3abff65874
Mikhail Pochatkin
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.
Abhishek Bansal
MDEV-38474: ASAN heap-use-after-free in st_select_lex_unit::cleanup

cleanup_stranded_units() was added at the start of
st_select_lex_unit::cleanup() by 34a8209d6657. This causes a
use-after-free when nested subqueries are merged into their parent
unit. With nested subqueries like:

  SELECT * FROM t1
  WHERE a IN (SELECT b FROM t2
              WHERE a IN (SELECT c FROM t3 WHERE FALSE HAVING c < 0));

the stranded_clean_list chains the units as: Unit1 -> Unit2 -> Unit3.
Because cleanup_stranded_units() was called first, Unit1->cleanup()
would recursively trigger Unit2->cleanup(), which in turn would
trigger Unit3->cleanup(). Unit3's cleanup frees its heap-allocated
join structures. But since Unit3 was merged into Unit2, Unit2 still
holds references to Unit3's structures (e.g., st_join_table). When
control returns to Unit2 for its own local cleanup, it accesses
already-freed memory.

Fix: move cleanup_stranded_units() to the end of cleanup(). This way,
each unit completes its own local cleanup first—clearing its
references to any child structures—before triggering cleanup of its
stranded (child) units. This enforces a parent-first cleanup order.
Marko Mäkelä
MDEV-39263 innodb_snapshot_isolation fails to prevent lost updates under contention

lock_clust_rec_read_check_and_lock(): Refine the check whether
the transaction that last modified the record is still active.
The only thing that should matter is whether we are allowed to see
the record. If the implicit lock holder transaction was active and
we succeeded in acquiring the lock, this means that the transaction
had been committed. We must return DB_RECORD_CHANGED (ER_CHECKREAD)
in that case. We want to avoid returning it before the lock wait,
in case the other transaction will be rolled back.

Thanks to Vadim Tkachenko of Percona for reporting this bug,
as well as Kyle Kingsbury for the broader testing that led to this
finding. Vadim's test case was simplified by me and the root cause
analyzed with https://rr-project.org and an additional patch that
added std::this_thread::yield() at the start of
trx_t::commit_persist(). An even better spot should have been
right after the call to trx_t::commit_state().

The addition to the test innodb.lock_isolation is based on the work
by Teemu Ollakka, which was essential for refining this fix.

Reviewed by: Thirunarayanan Balathandayuthapani
Anway Durge
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 <[email protected]>
Sergei Golubchik
MDEV-23507 Wrong duplicate key value printed in ER_DUP_ENTRY

repair_by_sort() does not use table->record[0]
but print_keydup_error() expects to see the conflicting row there.
ParadoxV5
Merge branch '10.11' into MDEV-39240
Sergei Golubchik
MDEV-39131 Wrong Results in Identical Queries Involving Grouping and Bitwise NOT (~)

Item_copy_string::val_int() should take into account item's
unsignedness
Jan Lindström
MGL-67 : Add --galera-info parameter for mysqldump tool

Added --galera-info parameter for mysqldump tool and this
will add SET GLOBAL wsrep_start_position line at the
end of the dump. This line is based on added wsrep status
variable wsrep-checkpoint-position.

Added also status variable wsrep-se-checkpoint.
Sergei Golubchik
MDEV-39112 The query returns incorrect results when using LPAD

LPAD was modifying its first argument, even if it was a const string
Oleksandr Byelkin
MDEV-39389 Memory leaks in _db_set_init

Handle forgotten case of resetting parameters
(free command_line before assigning a new one).
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

XML parser fixed to handle <! and <? correctly.
Raghunandan Bhat
MDEV-39118: `test_if_hard_path` crashes on recursively resolving `$HOME`

Problem:
  When `$HOME` is set to `~/` (or any string starting with `~/`), the
  `home_dir` is initialized to that value. When `test_if_hard_path` is
  called on a path starting with `~/`, it replaces the `~/` prefix by
  recursively calling `test_if_hard_path(home_dir)` leading to infinite
  recursion and a crash.

Fix:
  Add a check in `test_if_hard_path` to see if `home_dir` itself begins
  with `~/`. If it does, skip the recursive call to prevent the
  infinite loop.
Dave Gosselin
MDEV-39209: use iterative cleanup for merged units to avoid stack overflow

Query optimization can merge derived tables (VIEWs being a type of derived
table) into outer queries, leaving behind stranded  st_select_lex_unit objects
("stranded units") for post-query cleanup.

Previously, these were cleaned up recursively. For queries with many merged
derived tables, the deep recursion over the list of stranded units could
exhaust the stack. This change replaces the recursive cleanup with an
iterative loop to prevent stack overflows.
ParadoxV5
Fix fault injection `simulate_find_log_pos_error`

`DBUG_EXECUTE_IF` is a macro that uses
the infamous `do {…} while(0)` “idiom”.
This detail causes the `break` in the code block to terminate the
`while(0)` behind the macro instead of the `for (;;)` outside.
Consequently, this fault simulation does not terminate the normal flow,
which in turn overwrites the simulated fault with a non-fault outcome.

Since this fault simulation is the first step of the loop,
this commit fixes the fault injection by moving it before the loop.
Tony Chen
MDEV-34210 Improve auto-inc upgrade check message

In commit 0381921e, logic was added to fix bogus values of PAGE_ROOT_AUTO_INC
when upgrading from MySQL or versions of MariaDB < 10.2.10. As part of this
change, if a table's frm version was less than 10.2.10 and the server was in a
read-only state (preventing the frm version from being updated), a message was
introduced during the execution of CHECK TABLE FOR UPGRADE informing users that
the auto_increment check would be performed on each open of the table.

However, this message didn't mention the fact that the server being in a
read-only state would prevent the frm version from being updated thus causing
confusion as the message would not go away even after running CHECK TABLE FOR
UPGRADE.

The message is now improved for clarity.

Additionally, we remove a redundant check in ha_innobase::check. A small
simplification is made to ha_innobase::check() by removing redundant checks for
`check_for_upgrade()` and handler_flags.  ha_innobase::handler_flags is only
set by `check_for_upgrade()`.

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.
Daniel Black
Cleanup memory from OpenSSL at exit (fix)

OpenSSL is optional, and it requires a OpenSSL1.1.1+
version to have OpenSSL_cleanup. This failed in a
RHEL7 builder.
Rucha Deodhar
MDEV-33843: Server crashes by stack-overflow with UPDATEXML

Analysis:
The stack size if insufficient and there is no stack overrun check.

Fix:
Add stack overrun check.
Sergei Golubchik
MDEV-39111 The query returns an incorrect value when using LPAD and REPLACE

REPLACE() tries to modify its first argument in-place, provided it's
not a constant (like in REPLACE("foo", "bar"))

When the first argument was Item_cache_str, it was not marked as
a constant, thus REPLACE modified it in-place, and result of the
previous row leaked into the next one.
Sergei Golubchik
MDEV-39292 Debian build compiles Columnstore aarch64

only enable ColumnStore for architectures it supports
Sergei Golubchik
MDEV-39112 fix RPAD too
Marko Mäkelä
Merge 10.6 into 10.11
Rucha Deodhar
MDEV-39179: Incorrect NULL handling in UPDATE ... RETURNING result

Analysis:
OLD_VALUE() swapped only field->ptr, leaving null_ptr pointing to the
current record. This caused incorrect NULL results.

Fix:
Store null_ptr_old for record[1] and swap it together with ptr to
preserve correct NULL semantics.
Varun Deep Saini
MDEV-35548: Fix out-of-bounds array access in json_get_path_start

json_get_path_start() set p->last_step to p->steps - 1, creating a
pointer before the beginning of the steps[] array. This is undefined
behavior flagged by UBSAN as "index -1 out of bounds for type
json_path_step_t[32]".

Use NULL as the sentinel value instead, and check for NULL in
json_get_path_next() rather than comparing against p->steps.

Signed-off-by: Varun Deep Saini <[email protected]>
Signed-off-by: Varun Deep Saini <[email protected]>
Oleksandr Byelkin
MDEV-39389 Memory leaks in _db_set_init

Handle forgotten case of resetting parameters
(free command_line before assigning a new one).
Marko Mäkelä
MDEV-39264: Improve the documentation of ER_CHECKREAD

Similar to ER_LOCK_DEADLOCK and ER_LOCK_WAIT_TIMEOUT, let the ER_CHECKREAD
message suggest that the transaction needs to be restarted. When this error
is reported by InnoDB (only if innodb_snapshot_isolation=ON),
the transaction will be rolled back.

Reviewed by: Sergei Golubchik
Sergei Golubchik
Un-deprecate keep_files_on_create

originally (MDEV-23570) the idea was to make it TRUE and deprecate.
It cannot be deprecated when it's FALSE, but TRUE breaks
mariabackup.aria_backup where a table is altered from Aria to InnoDB
during a backup, so both t.MAD/t.MAI and t.ibd gets into a backup.
This is MDEV-38866, when it's fixed, keep_files_on_create can be
enabled by default and deprecated at last.
Daniel Black
MDEV-39292 Debian build compiles Columnstore aarch64

But doesn't package it. The devel-6 branch of columnstore
is in a low maintaince state. We can't readd aarch64.

To prevent our CI resources building aarch64 columnstore
on the 10.6 and 10.11 branches we adjust our autobake-deb.sh
to keep the disable there.

The version check to 10 is so that when this is merged to
11.4 it becomes no longer impacting.
Yuchen Pei
Move archive engine part in test sql_sequence.create to a separate test

...so that sql_sequence.create can be tested without having to build
the archive engine
Sergei Golubchik
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)`